diff options
Diffstat (limited to 'internal/config')
| -rw-r--r-- | internal/config/atomicfile/atomicfile.go | 4 | ||||
| -rw-r--r-- | internal/config/atomicfile/atomicfile_test.go | 4 | ||||
| -rw-r--r-- | internal/config/v1/v1.go | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/internal/config/atomicfile/atomicfile.go b/internal/config/atomicfile/atomicfile.go index 5c18e85..542f58a 100644 --- a/internal/config/atomicfile/atomicfile.go +++ b/internal/config/atomicfile/atomicfile.go @@ -29,8 +29,8 @@ func WriteFile(filename string, data []byte, perm os.FileMode) (err error) { tmpName := f.Name() defer func() { if err != nil { - f.Close() - os.Remove(tmpName) + f.Close() //nolint:errcheck + os.Remove(tmpName) //nolint:errcheck } }() if _, err := f.Write(data); err != nil { diff --git a/internal/config/atomicfile/atomicfile_test.go b/internal/config/atomicfile/atomicfile_test.go index 670d225..f14cb31 100644 --- a/internal/config/atomicfile/atomicfile_test.go +++ b/internal/config/atomicfile/atomicfile_test.go @@ -24,7 +24,7 @@ func TestDoesNotOverwriteIrregularFiles(t *testing.T) { // macOS private temp does not allow unix socket creation, but /tmp does. if runtime.GOOS == "darwin" { path = filepath.Join("/tmp", filename) - t.Cleanup(func() { os.Remove(path) }) + t.Cleanup(func() { os.Remove(path) }) //nolint:errcheck } else { path = filepath.Join(t.TempDir(), filename) } @@ -35,7 +35,7 @@ func TestDoesNotOverwriteIrregularFiles(t *testing.T) { if err != nil { t.Fatal(err) } - defer l.Close() + defer l.Close() //nolint:errcheck err = WriteFile(path, []byte("hello"), 0o644) if err == nil { diff --git a/internal/config/v1/v1.go b/internal/config/v1/v1.go index 973c3d3..5f5cd93 100644 --- a/internal/config/v1/v1.go +++ b/internal/config/v1/v1.go @@ -64,11 +64,15 @@ type SecureInternetHome struct { CurrentLocation string `json:"current_location"` } +// Type is the type of server, a server from discovery or one entered manually by typing it in the client type Type int8 const ( + // CustomServerType is the type of server that is manually added by typing a URL CustomServerType Type = iota + // InstituteAccessServerType is the type of server that is in the discovery server_list.json with type "institute_access" InstituteAccessServerType + // SecureInternetServerType is the type of server that is in the discovery server_list.json with type "secure_internet" SecureInternetServerType ) |
