@@ -158,7 +158,7 @@ func TestDrainSignals(t *testing.T) {
158158}
159159
160160// TestDrainSignalsEmpty verifies drainSignals is a no-op on empty channel.
161- func TestDrainSignalsEmpty (t * testing.T ) {
161+ func TestDrainSignalsEmpty (_ * testing.T ) {
162162 ch := make (chan os.Signal , 5 )
163163 drainSignals (ch ) // should not block
164164}
@@ -357,7 +357,7 @@ credential = "example_key"
357357header = "Authorization"
358358template = "Bearer {value}"
359359`
360- if err := os .WriteFile (tomlPath , []byte (tomlData ), 0644 ); err != nil {
360+ if err := os .WriteFile (tomlPath , []byte (tomlData ), 0o644 ); err != nil {
361361 t .Fatal (err )
362362 }
363363
@@ -522,8 +522,8 @@ func TestReadVaultConfig(t *testing.T) {
522522 vaddr := "https://vault.example.com:8200"
523523 vmount := "secret"
524524 _ = db .UpdateConfig (store.ConfigUpdate {
525- VaultProvider : & vprov ,
526- VaultHashicorpAddr : & vaddr ,
525+ VaultProvider : & vprov ,
526+ VaultHashicorpAddr : & vaddr ,
527527 VaultHashicorpMount : & vmount ,
528528 })
529529
@@ -733,7 +733,7 @@ func TestIsDockerSocketAvailable(t *testing.T) {
733733 if err != nil {
734734 t .Fatal (err )
735735 }
736- defer l .Close ()
736+ defer func () { _ = l .Close () } ()
737737
738738 if ! isDockerSocketAvailable (sockPath ) {
739739 t .Error ("expected true for real Unix socket" )
@@ -746,7 +746,7 @@ func TestIsDockerSocketAvailable(t *testing.T) {
746746
747747 // Regular file is not a socket.
748748 regularPath := filepath .Join (dir , "file.txt" )
749- if err := os .WriteFile (regularPath , []byte ("hello" ), 0644 ); err != nil {
749+ if err := os .WriteFile (regularPath , []byte ("hello" ), 0o644 ); err != nil {
750750 t .Fatal (err )
751751 }
752752 if isDockerSocketAvailable (regularPath ) {
@@ -765,7 +765,7 @@ func TestIsAppleCLIAvailable(t *testing.T) {
765765}
766766
767767// TestIsTartCLIAvailable verifies the function returns without panicking.
768- func TestIsTartCLIAvailable (t * testing.T ) {
768+ func TestIsTartCLIAvailable (_ * testing.T ) {
769769 // Just verify the function doesn't panic. tart may or may not be installed.
770770 _ = isTartCLIAvailable ()
771771}
@@ -835,13 +835,12 @@ func TestStandaloneModeStartup(t *testing.T) {
835835 }
836836}
837837
838-
839838// TestBuildSelfBypass verifies the self-bypass address expansion.
840839func TestBuildSelfBypass (t * testing.T ) {
841840 tests := []struct {
842- name string
843- addr string
844- want []string
841+ name string
842+ addr string
843+ want []string
845844 }{
846845 {
847846 name : "specific IP" ,
@@ -1007,7 +1006,7 @@ ports = [443]
10071006credential = "seeded_key"
10081007header = "Authorization"
10091008`
1010- if err := os .WriteFile (tomlPath , []byte (tomlData ), 0644 ); err != nil {
1009+ if err := os .WriteFile (tomlPath , []byte (tomlData ), 0o644 ); err != nil {
10111010 t .Fatal (err )
10121011 }
10131012
@@ -1141,7 +1140,7 @@ default = "deny"
11411140destination = "seeded.example.com"
11421141ports = [443]
11431142`
1144- if err := os .WriteFile (tomlPath , []byte (tomlData ), 0644 ); err != nil {
1143+ if err := os .WriteFile (tomlPath , []byte (tomlData ), 0o644 ); err != nil {
11451144 t .Fatal (err )
11461145 }
11471146
@@ -1190,7 +1189,7 @@ func TestSeedStoreFromConfigMissing(t *testing.T) {
11901189func TestSeedStoreFromConfigMalformed (t * testing.T ) {
11911190 dir := t .TempDir ()
11921191 tomlPath := filepath .Join (dir , "bad.toml" )
1193- if err := os .WriteFile (tomlPath , []byte ("not valid toml [[[" ), 0644 ); err != nil {
1192+ if err := os .WriteFile (tomlPath , []byte ("not valid toml [[[" ), 0o644 ); err != nil {
11941193 t .Fatal (err )
11951194 }
11961195
@@ -1355,7 +1354,7 @@ func TestMacOSRuntimeSelectionRequiresExplicit(t *testing.T) {
13551354// shutdownMacOSVM accepts the expected parameter types (including nil router
13561355// and ownership boolean).
13571356var (
1358- _ container.ContainerManager = (* container .TartManager )(nil )
1357+ _ container.ContainerManager = (* container .TartManager )(nil )
13591358 _ func (* container.TartManager , * container.NetworkRouter , bool ) = shutdownMacOSVM
13601359)
13611360
0 commit comments