Skip to content

Commit 7d40142

Browse files
authored
Merge pull request #167 from VaibhavMalik4187/go-version-update
Updated the go version in github actions to 1.20
2 parents f7cfffb + fd773c1 commit 7d40142

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
env:
2+
GO_VERSION: '1.20'
3+
14
name: Meshery NSM
25
on:
36
push:
@@ -14,14 +17,18 @@ jobs:
1417
runs-on: ubuntu-latest
1518
steps:
1619
- name: Check out code
17-
uses: actions/checkout@master
20+
uses: actions/checkout@v3
1821
with:
1922
fetch-depth: 1
2023
- name: Setup Go
21-
uses: actions/setup-go@v1
24+
uses: actions/setup-go@v4
25+
with:
26+
go-version: ${{ env.GO_VERSION }}
27+
- name: golangci-lint
28+
uses: golangci/golangci-lint-action@v3
2229
with:
23-
go-version: ${{ secrets.GO_VERSION }}
24-
- run: GOPROXY=direct GOSUMDB=off go get -u golang.org/x/lint/golint; go list ./... | grep -v /vendor/ | xargs -L1 /home/runner/go/bin/golint -set_exit_status
30+
version: v1.52
31+
args: --timeout=5m
2532
error_check:
2633
name: Error check
2734
runs-on: ubuntu-latest
@@ -31,10 +38,10 @@ jobs:
3138
with:
3239
fetch-depth: 1
3340
- name: Setup Go
34-
uses: actions/setup-go@v1
41+
uses: actions/setup-go@v4
3542
with:
36-
go-version: ${{ secrets.GO_VERSION }}
37-
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u github.com/kisielk/errcheck; /home/runner/go/bin/errcheck -tags draft ./...
43+
go-version: ${{ env.GO_VERSION }}
44+
- run: go install github.com/kisielk/errcheck@latest; errcheck -tags draft ./...
3845
static_check:
3946
name: Static check
4047
runs-on: ubuntu-latest
@@ -44,10 +51,10 @@ jobs:
4451
with:
4552
fetch-depth: 1
4653
- name: Setup Go
47-
uses: actions/setup-go@v1
54+
uses: actions/setup-go@v4
4855
with:
49-
go-version: ${{ secrets.GO_VERSION }}
50-
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u honnef.co/go/tools/cmd/staticcheck; PKGS=$(go list ./... | grep -vF /meshes); /home/runner/go/bin/staticcheck -tags draft -checks all $PKGS # https://staticcheck.io/docs/checks
56+
go-version: ${{ env.GO_VERSION }}
57+
- run: go install honnef.co/go/tools/cmd/staticcheck@latest; PKGS=$(go list ./... | grep -vF /meshes); staticcheck -tags draft -checks all $PKGS # https://staticcheck.io/docs/checks
5158
# vet:
5259
# name: Vet
5360
# runs-on: ubuntu-latest
@@ -59,7 +66,7 @@ jobs:
5966
# - name: Setup Go
6067
# uses: actions/setup-go@v1
6168
# with:
62-
# go-version: ${{ secrets.GO_VERSION }}
69+
# go-version: ${{ env.GO_VERSION }}
6370
# - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./...
6471
# sec_check:
6572
# name: Security check
@@ -72,7 +79,7 @@ jobs:
7279
# - name: Setup Go
7380
# uses: actions/setup-go@v1
7481
# with:
75-
# go-version: ${{ secrets.GO_VERSION }}
82+
# go-version: ${{ env.GO_VERSION }}
7683
# - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get github.com/securego/gosec/cmd/gosec; /home/runner/go/bin/gosec ./... # https://github.com/securego/gosec
7784
# tests:
7885
# # needs: [lint, error_check, static_check, vet, sec_check]
@@ -86,7 +93,7 @@ jobs:
8693
# - name: Setup Go
8794
# uses: actions/setup-go@v1
8895
# with:
89-
# go-version: ${{ secrets.GO_VERSION }}
96+
# go-version: ${{ env.GO_VERSION }}
9097
# - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go test -tags draft ./...
9198
build:
9299
name: Build check
@@ -98,7 +105,7 @@ jobs:
98105
with:
99106
fetch-depth: 1
100107
- name: Setup Go
101-
uses: actions/setup-go@v1
108+
uses: actions/setup-go@v4
102109
with:
103-
go-version: ${{ secrets.GO_VERSION }}
104-
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build .
110+
go-version: ${{ env.GO_VERSION }}
111+
- run: go build .

.github/workflows/error-ref-publisher.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
env:
2+
GO_VERSION: 1.20
3+
14
name: Meshkit Error Codes Utility Runner
25
on:
36
push:
@@ -21,7 +24,7 @@ jobs:
2124
- name: Setup Go
2225
uses: actions/setup-go@v1
2326
with:
24-
go-version: ${{ secrets.GO_VERSION }}
27+
go-version: ${{ env.GO_VERSION }}
2528

2629
- name: Run utility
2730
run: |
@@ -61,4 +64,4 @@ jobs:
6164
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
6265
commit_options: '--signoff'
6366
commit_message: '[Docs] Error Code Reference: Meshery Adapter for for NSM updated'
64-
file_pattern: docs/
67+
file_pattern: docs/

internal/config/releases.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package config
33
import (
44
"encoding/json"
55
"fmt"
6-
"io/ioutil"
6+
"io"
77
"net/http"
88
"regexp"
99
"sort"
@@ -76,7 +76,7 @@ func GetLatestReleases(releases uint) ([]*Release, error) {
7676
return []*Release{}, ErrGetLatestReleases(fmt.Errorf("unexpected status code: %d", resp.StatusCode))
7777
}
7878

79-
body, err := ioutil.ReadAll(resp.Body)
79+
body, err := io.ReadAll(resp.Body)
8080
if err != nil {
8181
return []*Release{}, ErrGetLatestReleases(err)
8282
}

0 commit comments

Comments
 (0)