瀏覽代碼

linter errors fixed

Signed-off-by: kimdcottrell <[email protected]>
kimdcottrell 2 年之前
父節點
當前提交
616bba0afd
共有 2 個文件被更改,包括 8 次插入5 次删除
  1. 3 2
      pkg/compose/create.go
  2. 5 3
      pkg/e2e/watch_test.go

+ 3 - 2
pkg/compose/create.go

@@ -1131,11 +1131,12 @@ func (s *composeService) resolveExternalNetwork(ctx context.Context, n *types.Ne
 
 
 	if len(networks) == 0 {
 	if len(networks) == 0 {
 		// in this instance, n.Name is really an ID
 		// in this instance, n.Name is really an ID
-		network, err := s.apiClient().NetworkInspect(ctx, n.Name, moby.NetworkInspectOptions{})
-		networks = append(networks, network)
+		sn, err := s.apiClient().NetworkInspect(ctx, n.Name, moby.NetworkInspectOptions{})
 		if err != nil {
 		if err != nil {
 			return err
 			return err
 		}
 		}
+		networks = append(networks, sn)
+
 	}
 	}
 
 
 	// NetworkList API doesn't return the exact name match, so we can retrieve more than one network with a request
 	// NetworkList API doesn't return the exact name match, so we can retrieve more than one network with a request

+ 5 - 3
pkg/e2e/watch_test.go

@@ -80,8 +80,9 @@ func TestRebuildOnDotEnvWithExternalNetwork(t *testing.T) {
 	assert.Assert(t, !strings.Contains(res.Combined(), projectName), res.Combined())
 	assert.Assert(t, !strings.Contains(res.Combined(), projectName), res.Combined())
 
 
 	t.Log("create a dotenv file that will be used to trigger the rebuild")
 	t.Log("create a dotenv file that will be used to trigger the rebuild")
-	os.WriteFile(dotEnvFilepath, []byte("HELLO=WORLD"), 0666)
-	_, err := os.ReadFile(dotEnvFilepath)
+	err := os.WriteFile(dotEnvFilepath, []byte("HELLO=WORLD"), 0o666)
+	assert.NilError(t, err)
+	_, err = os.ReadFile(dotEnvFilepath)
 	assert.NilError(t, err)
 	assert.NilError(t, err)
 
 
 	// TODO: refactor this duplicated code into frameworks? Maybe?
 	// TODO: refactor this duplicated code into frameworks? Maybe?
@@ -114,7 +115,8 @@ func TestRebuildOnDotEnvWithExternalNetwork(t *testing.T) {
 	assert.Equal(t, pn.Stdout(), n.Stdout())
 	assert.Equal(t, pn.Stdout(), n.Stdout())
 
 
 	t.Log("create a dotenv file that will be used to trigger the rebuild")
 	t.Log("create a dotenv file that will be used to trigger the rebuild")
-	os.WriteFile(dotEnvFilepath, []byte("HELLO=WORLD\nTEST=REBUILD"), 0666)
+	err = os.WriteFile(dotEnvFilepath, []byte("HELLO=WORLD\nTEST=REBUILD"), 0o666)
+	assert.NilError(t, err)
 	_, err = os.ReadFile(dotEnvFilepath)
 	_, err = os.ReadFile(dotEnvFilepath)
 	assert.NilError(t, err)
 	assert.NilError(t, err)