From bfc3eba7b4e13047c45c2ac7710bcaf326c6815b Mon Sep 17 00:00:00 2001 From: tony Date: Fri, 26 Jul 2024 14:54:20 +0800 Subject: [PATCH] temp --- .github/workflows/test.yaml | 3 +-- internal/build/util.go | 13 ++----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7bede1ec2935..a644e9033edf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,8 +23,7 @@ jobs: go-version: ${{ matrix.go-version }} - name: Make - run: | - make + run: make all - name: Make Test id: unit-test diff --git a/internal/build/util.go b/internal/build/util.go index 0b3cc85d1495..a6a944ddbe30 100644 --- a/internal/build/util.go +++ b/internal/build/util.go @@ -163,22 +163,13 @@ func ExpandPackagesNoVendor(patterns []string) []string { } if expand { cmd := GoTool("list", patterns...) - var ( - stdout bytes.Buffer - stderr bytes.Buffer - ) - cmd.Stdout = &stdout - cmd.Stderr = &stderr - err := cmd.Run() + out, err := cmd.Output() if err != nil { log.Fatalf("package listing failed: %v\n", err) } - fmt.Println(">>> go list STDOUT", string(stdout.Bytes())) - fmt.Println(">>> go list STDERR", string(stderr.Bytes())) - var packages []string - for _, line := range strings.Split(string(stdout.Bytes())+string(stderr.Bytes()), "\n") { + for _, line := range strings.Split(string(out), "\n") { if !strings.Contains(line, "/vendor/") { packages = append(packages, strings.TrimSpace(line)) }