File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1818
1919 - uses : golangci/golangci-lint-action@v6
2020 with :
21- version : latest
22- install-mode : goinstall
21+ version : v2.11.4
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package config
33import (
44 "os"
55 "path/filepath"
6+ "runtime"
67 "testing"
78)
89
@@ -27,13 +28,15 @@ func TestSaveAndLoad(t *testing.T) {
2728 t .Fatal (err )
2829 }
2930
30- // File must be owner-only
31- info , err := os .Stat (Path ())
32- if err != nil {
33- t .Fatal (err )
34- }
35- if perm := info .Mode ().Perm (); perm != 0o600 {
36- t .Errorf ("config file perms = %o, want 0600" , perm )
31+ // File must be owner-only (Unix only — Windows has no chmod)
32+ if runtime .GOOS != "windows" {
33+ info , err := os .Stat (Path ())
34+ if err != nil {
35+ t .Fatal (err )
36+ }
37+ if perm := info .Mode ().Perm (); perm != 0o600 {
38+ t .Errorf ("config file perms = %o, want 0600" , perm )
39+ }
3740 }
3841
3942 loaded , err := Load ()
@@ -60,6 +63,9 @@ func TestRequireAPIKey(t *testing.T) {
6063func TestPath (t * testing.T ) {
6164 home := t .TempDir ()
6265 t .Setenv ("HOME" , home )
66+ if runtime .GOOS == "windows" {
67+ t .Skip ("HOME env var not used for config path on Windows" )
68+ }
6369 want := filepath .Join (home , ".supermodel" , "config.yaml" )
6470 if got := Path (); got != want {
6571 t .Errorf ("Path() = %q, want %q" , got , want )
You can’t perform that action at this time.
0 commit comments