@@ -22,15 +22,13 @@ func TestNewDockerClientVersionNegotiation(t *testing.T) {
2222 originalAPIVersion := os .Getenv ("DOCKER_API_VERSION" )
2323 defer func () {
2424 if originalAPIVersion == "" {
25- os .Unsetenv ("DOCKER_API_VERSION" )
25+ _ = os .Unsetenv ("DOCKER_API_VERSION" )
2626 } else {
27- os .Setenv ("DOCKER_API_VERSION" , originalAPIVersion )
27+ _ = os .Setenv ("DOCKER_API_VERSION" , originalAPIVersion )
2828 }
2929 }()
3030
31- // Set DOCKER_API_VERSION to an old version that would cause
32- // "client version 1.25 is too old" errors if negotiation is disabled
33- os .Setenv ("DOCKER_API_VERSION" , "1.25" )
31+ _ = os .Setenv ("DOCKER_API_VERSION" , "1.25" )
3432
3533 t .Run ("FromEnv locks version preventing negotiation" , func (t * testing.T ) {
3634 // This demonstrates the problematic behavior we're avoiding.
@@ -41,7 +39,7 @@ func TestNewDockerClientVersionNegotiation(t *testing.T) {
4139 client .WithAPIVersionNegotiation (),
4240 )
4341 assert .NoError (t , err )
44- defer cli .Close ()
42+ defer func () { _ = cli .Close () } ()
4543
4644 // Version is locked to the env var value
4745 assert .Equal (t , "1.25" , cli .ClientVersion ())
@@ -53,7 +51,7 @@ func TestNewDockerClientVersionNegotiation(t *testing.T) {
5351 // (unix socket on Linux/macOS, named pipe on Windows).
5452 cli , err := newDockerClient (client .DefaultDockerHost )
5553 assert .NoError (t , err )
56- defer cli .Close ()
54+ defer func () { _ = cli .Close () } ()
5755
5856 // Version is NOT locked to the env var value (1.25).
5957 // Instead, it uses the library's default version and will negotiate
0 commit comments