From cf36729ebf91a140c8743c8fc6671a0186ad4e75 Mon Sep 17 00:00:00 2001 From: sethiyash Date: Wed, 3 May 2023 12:21:49 +0530 Subject: [PATCH 1/3] Bump golang 1.20.3 and golint changes Signed-off-by: sethiyash --- .github/workflows/golangci-lint.yml | 8 ++++---- .github/workflows/release.yml | 2 +- .github/workflows/test-gh.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- cmd/vendir/vendir.go | 2 +- go.mod | 2 +- pkg/vendir/directory/staging_dir.go | 4 ++-- pkg/vendir/fetch/ref_fetcher.go | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 84299691..cd0de62a 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -12,16 +12,16 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - name: Install Go 1.19.6 + - name: Install Go uses: actions/setup-go@v3 with: - go-version: "1.19.6" + go-version: "1.20.3" - uses: actions/checkout@v2 with: fetch-depth: '0' - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v3.4.0 with: - version: v1.50.1 + version: v1.52.2 args: -v diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57f6180e..8d6204c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.19.6 + go-version: 1.20.3 - name: Retrieve version run: | echo "TAG_NAME=$(echo ${{ github.ref }} | grep -Eo 'v[0-9].*')" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test-gh.yml b/.github/workflows/test-gh.yml index 856dc0e6..285782e2 100644 --- a/.github/workflows/test-gh.yml +++ b/.github/workflows/test-gh.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v1 with: - go-version: "1.19.6" + go-version: "1.20.3" - name: Check out code into the Go module directory uses: actions/checkout@v1 with: diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 605639e3..4d01befc 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -10,7 +10,7 @@ jobs: with: repo: carvel-dev/vendir tool: vendir - goVersion: 1.19.6 + goVersion: 1.20.3 secrets: githubToken: ${{ secrets.GITHUB_TOKEN }} slackWebhookURL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/cmd/vendir/vendir.go b/cmd/vendir/vendir.go index 775d6713..02f86776 100644 --- a/cmd/vendir/vendir.go +++ b/cmd/vendir/vendir.go @@ -16,7 +16,7 @@ import ( ) func main() { - rand.Seed(time.Now().UTC().UnixNano()) + rand.New(rand.NewSource(time.Now().UTC().UnixNano())) log.SetOutput(ioutil.Discard) diff --git a/go.mod b/go.mod index 43d5a52d..30982d68 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/vmware-tanzu/carvel-vendir -go 1.19 +go 1.20 require ( github.com/bmatcuk/doublestar v1.2.1 diff --git a/pkg/vendir/directory/staging_dir.go b/pkg/vendir/directory/staging_dir.go index dbc9e183..66c738cb 100644 --- a/pkg/vendir/directory/staging_dir.go +++ b/pkg/vendir/directory/staging_dir.go @@ -105,7 +105,7 @@ func (d StagingDir) CopyExistingFiles(rootDir string, stagingPath string, ignore } // Move the file to the staging directory - err = copy(path, stagingPath) + err = copyFile(path, stagingPath) if err != nil { return fmt.Errorf("Moving source file '%s' to staging location '%s': %s", path, stagingPath, err) } @@ -195,7 +195,7 @@ func (d StagingTempArea) NewTempFile(pattern string) (*os.File, error) { return ioutil.TempFile(d.path, pattern) } -func copy(src, dst string) error { +func copyFile(src, dst string) error { sourceFileStat, err := os.Stat(src) if err != nil { return fmt.Errorf("Unable to read file info: %s", src) diff --git a/pkg/vendir/fetch/ref_fetcher.go b/pkg/vendir/fetch/ref_fetcher.go index f52cdbe5..811c4138 100644 --- a/pkg/vendir/fetch/ref_fetcher.go +++ b/pkg/vendir/fetch/ref_fetcher.go @@ -27,6 +27,6 @@ func (f SingleSecretRefFetcher) GetSecret(name string) (ctlconf.Secret, error) { return ctlconf.Secret{}, fmt.Errorf("Not found") } -func (f SingleSecretRefFetcher) GetConfigMap(name string) (ctlconf.ConfigMap, error) { +func (f SingleSecretRefFetcher) GetConfigMap(_ string) (ctlconf.ConfigMap, error) { return ctlconf.ConfigMap{}, fmt.Errorf("Not found") } From 157ecad6094b1309c4b95fcdd83d4ad5dcb27635 Mon Sep 17 00:00:00 2001 From: sethiyash Date: Mon, 29 May 2023 22:46:32 +0530 Subject: [PATCH 2/3] Bumping Go version to 1.20.4 Signed-off-by: sethiyash --- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test-gh.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index cd0de62a..14571d28 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: "1.20.3" + go-version: 1.20.4 - uses: actions/checkout@v2 with: fetch-depth: '0' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d6204c7..ab886fc2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.20.3 + go-version: 1.20.4 - name: Retrieve version run: | echo "TAG_NAME=$(echo ${{ github.ref }} | grep -Eo 'v[0-9].*')" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test-gh.yml b/.github/workflows/test-gh.yml index 285782e2..768ce58d 100644 --- a/.github/workflows/test-gh.yml +++ b/.github/workflows/test-gh.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v1 with: - go-version: "1.20.3" + go-version: 1.20.4 - name: Check out code into the Go module directory uses: actions/checkout@v1 with: diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 4d01befc..3cebea43 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -10,7 +10,7 @@ jobs: with: repo: carvel-dev/vendir tool: vendir - goVersion: 1.20.3 + goVersion: 1.20.4 secrets: githubToken: ${{ secrets.GITHUB_TOKEN }} slackWebhookURL: ${{ secrets.SLACK_WEBHOOK_URL }} From 80450223dc2751480116b6a465e13279dc9c2e65 Mon Sep 17 00:00:00 2001 From: sethiyash Date: Mon, 12 Jun 2023 11:46:21 +0530 Subject: [PATCH 3/3] Bumping go version to 1.20.5 Signed-off-by: sethiyash --- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test-gh.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 14571d28..aa5c8e29 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: 1.20.4 + go-version: 1.20.5 - uses: actions/checkout@v2 with: fetch-depth: '0' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab886fc2..ba7b3c13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.20.4 + go-version: 1.20.5 - name: Retrieve version run: | echo "TAG_NAME=$(echo ${{ github.ref }} | grep -Eo 'v[0-9].*')" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test-gh.yml b/.github/workflows/test-gh.yml index 768ce58d..3e315680 100644 --- a/.github/workflows/test-gh.yml +++ b/.github/workflows/test-gh.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v1 with: - go-version: 1.20.4 + go-version: 1.20.5 - name: Check out code into the Go module directory uses: actions/checkout@v1 with: diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 3cebea43..a6e42c4e 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -10,7 +10,7 @@ jobs: with: repo: carvel-dev/vendir tool: vendir - goVersion: 1.20.4 + goVersion: 1.20.5 secrets: githubToken: ${{ secrets.GITHUB_TOKEN }} slackWebhookURL: ${{ secrets.SLACK_WEBHOOK_URL }}