Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update go to 1.18 #37

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18
- name: Setup envs
run: |
echo GOPATH=$GITHUB_WORKSPACE >> $GITHUB_ENV
Expand Down Expand Up @@ -53,11 +53,11 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.35
version: v1.45.2

excludeFmtErrorf:
name: exclude fmt.Errorf
Expand All @@ -77,9 +77,9 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18
- run: go mod tidy
- name: Check for changes in go.mod or go.sum
run: |
git diff --name-only --exit-code go.mod || ( echo "Run go tidy" && false )
git diff --name-only --exit-code go.sum || ( echo "Run go tidy" && false )
git diff --name-only --exit-code go.sum || ( echo "Run go tidy" && false )
2 changes: 1 addition & 1 deletion .github/workflows/update-dependent-repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18
- name: Setup envs
run: |
echo GOPATH=$GITHUB_WORKSPACE >> $GITHUB_ENV
Expand Down
20 changes: 15 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ linters-settings:
values:
regexp:
company: .*
copyright-holder: Copyright \(c\) ({{year-range}}) {{company}}\n\n
copyright-holders: ({{copyright-holder}})+
copyright-holder-curr: Copyright \(c\) ({{year-range}}) {{company}}\n\n
copyright-holder: Copyright \(c\) .*\n\n
copyright-holders: ({{copyright-holder}})*({{copyright-holder-curr}})+({{copyright-holder}})*
errcheck:
check-type-assertions: false
check-blank: false
Expand All @@ -24,7 +25,7 @@ linters-settings:
- (github.com/sirupsen/logrus.FieldLogger).Warnf
- (github.com/sirupsen/logrus.FieldLogger).Errorf
- (github.com/sirupsen/logrus.FieldLogger).Fatalf
golint:
revive:
min-confidence: 0.8
goimports:
local-prefixes: github.com/networkservicemesh
Expand Down Expand Up @@ -143,7 +144,7 @@ linters:
- gocyclo
- gofmt
- goimports
- golint
- revive
- gosec
- gosimple
- govet
Expand All @@ -152,7 +153,7 @@ linters:
# - lll
- misspell
- nakedret
- scopelint
- exportloopref
- staticcheck
- structcheck
- stylecheck
Expand All @@ -166,3 +167,12 @@ issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
- path: internal/generator/generator.go
linters:
- staticcheck
text: "SA1019: strings.Title is deprecated"
- path: internal/generator/suite.go
linters:
- staticcheck
text: "SA1019: strings.Title is deprecated"
11 changes: 10 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
module github.com/networkservicemesh/gotestmd

go 1.16
go 1.18

require (
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.7.0
github.com/stretchr/testify v1.6.1
go.uber.org/goleak v1.1.10
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 // indirect
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
6 changes: 4 additions & 2 deletions pkg/suites/shell/suite_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2022 Cisco and/or its affiliates.
//
// Copyright (c) 2021 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -40,7 +42,7 @@ func TestShellFirstTry(t *testing.T) {
fileName := "TestShellFirstTry.file"

r.Run("echo " + fileContent + " >" + fileName)
bytes, err := os.ReadFile(filepath.Join(tempDir, fileName))
bytes, err := os.ReadFile(filepath.Clean(filepath.Join(tempDir, fileName)))
require.NoError(t, err)
require.Equal(t, fileContent+"\n", string(bytes))
}
Expand All @@ -63,7 +65,7 @@ func TestShellEventually(t *testing.T) {
echo >&2 not enough ones
false
fi`)
bytes, err := os.ReadFile(filepath.Join(tempDir, fileName))
bytes, err := os.ReadFile(filepath.Clean(filepath.Join(tempDir, fileName)))
require.NoError(t, err)
require.Equal(t, "1\n11\n111\n", string(bytes))
}