From f6fe69e7e47957a54d4f6729f20d5f0531ce57dd Mon Sep 17 00:00:00 2001 From: devhindo Date: Sat, 28 Dec 2024 17:46:42 +0200 Subject: [PATCH] Update GitHub Actions workflows to use setup-go@v5 and golangci-lint-action@v6; refactor error formatting and import statements Signed-off-by: devhindo --- .github/workflows/build-and-release.yml | 2 +- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/component-generator.yml | 2 +- .github/workflows/error-ref-publisher.yml | 2 +- cilium/cilium.go | 2 +- cilium/oam.go | 2 +- cilium/oam/register.go | 2 +- main.go | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index dfbd826..30bb839 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -19,7 +19,7 @@ jobs: with: fetch-depth: 1 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.23 - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build . diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6922fa..d7814c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,12 @@ jobs: name: Check & Review code runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.23 - uses: actions/checkout@master - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: v1.54 @@ -40,7 +40,7 @@ jobs: with: fetch-depth: 1 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.23 - run: GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go install github.com/kisielk/errcheck@latest; /home/runner/go/bin/errcheck -tags draft ./... @@ -53,7 +53,7 @@ jobs: with: fetch-depth: 1 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.23 - run: | @@ -75,7 +75,7 @@ jobs: with: fetch-depth: 1 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.23 - uses: dominikh/staticcheck-action@v1.2.0 @@ -91,7 +91,7 @@ jobs: with: fetch-depth: 1 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.23 - run: GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./... @@ -121,7 +121,7 @@ jobs: with: fetch-depth: 1 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.23 - name: Create cluster using KinD diff --git a/.github/workflows/component-generator.yml b/.github/workflows/component-generator.yml index 8a74c2a..5618e7f 100644 --- a/.github/workflows/component-generator.yml +++ b/.github/workflows/component-generator.yml @@ -16,7 +16,7 @@ jobs: token: ${{ secrets.GH_ACCESS_TOKEN }} ref: "master" - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.23 - name: Run adapter to create components diff --git a/.github/workflows/error-ref-publisher.yml b/.github/workflows/error-ref-publisher.yml index 6be808b..6d17316 100644 --- a/.github/workflows/error-ref-publisher.yml +++ b/.github/workflows/error-ref-publisher.yml @@ -19,7 +19,7 @@ jobs: ref: 'master' - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.23 diff --git a/cilium/cilium.go b/cilium/cilium.go index a363263..47b8f0d 100644 --- a/cilium/cilium.go +++ b/cilium/cilium.go @@ -28,8 +28,8 @@ import ( "github.com/layer5io/meshkit/errors" "github.com/layer5io/meshkit/logger" "github.com/layer5io/meshkit/models" - "github.com/layer5io/meshkit/utils" "github.com/layer5io/meshkit/models/oam/core/v1alpha1" + "github.com/layer5io/meshkit/utils" "github.com/layer5io/meshkit/utils/events" "gopkg.in/yaml.v2" ) diff --git a/cilium/oam.go b/cilium/oam.go index c63a1fc..2288624 100644 --- a/cilium/oam.go +++ b/cilium/oam.go @@ -151,7 +151,7 @@ func mergeErrors(errs []error) error { errMsgs = append(errMsgs, err.Error()) } - return fmt.Errorf(strings.Join(errMsgs, "\n")) + return fmt.Errorf("%s", strings.Join(errMsgs, "\n")) } func mergeMsgs(strs []string) string { diff --git a/cilium/oam/register.go b/cilium/oam/register.go index 8a9ba2d..0d64cff 100644 --- a/cilium/oam/register.go +++ b/cilium/oam/register.go @@ -77,4 +77,4 @@ func loadMeshmodelComponents(basepath string) ([]meshmodelDefinitionPathSet, err } return res, nil -} \ No newline at end of file +} diff --git a/main.go b/main.go index 824269a..9cb674d 100644 --- a/main.go +++ b/main.go @@ -53,7 +53,7 @@ func init() { func main() { // Initialize Logger instance log, err := logger.New(serviceName, logger.Options{ - Format: logger.SyslogLogFormat, + Format: logger.SyslogLogFormat, }) if err != nil { fmt.Println(err)