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

bump: Update go to 1.18 #401

Merged
merged 1 commit into from
May 5, 2022
Merged
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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18.1
- name: Build
run: go build -race ./...
- name: Test
Expand All @@ -51,11 +51,11 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18.1
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.35.0
version: v1.45.2

excludeFmtErrorf:
name: exclude fmt.Errorf
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18.1
- run: go mod tidy
- name: Check for changes in go.mod or go.sum
run: |
Expand All @@ -109,11 +109,11 @@ jobs:
version: '3.8.0'
- uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18.1
- name: Install proto-gen-go
run: go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.3
run: go install github.com/golang/protobuf/protoc-gen-go@v1.4.2
- name: Install proto-gen-go
run: go get github.com/searKing/golang/tools/cmd/go-syncmap
run: go install github.com/searKing/golang/tools/cmd/go-syncmap@v1.1.68
- name: Generate files
run: go generate ./...
- name: Check for changes in generated code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18.1
- name: Update ${{ github.repository }} locally
working-directory: networkservicemesh/${{ matrix.repository }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-dependent-repositories-gomod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.18.1
- name: Update ${{ github.repository }} locally
working-directory: networkservicemesh/${{ matrix.repository }}
run: |
Expand Down
5 changes: 3 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ run:
timeout: 2m
issues-exit-code: 1
tests: true
go: "1.17"
linters-settings:
goheader:
template-path: ".ci/license/template.txt"
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/sdk-sriov
Expand Down Expand Up @@ -143,7 +144,7 @@ linters:
- gocyclo
- gofmt
- goimports
- golint
- revive
- gosec
- gosimple
- govet
Expand Down
45 changes: 43 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/networkservicemesh/sdk-sriov

go 1.16
go 1.18

require (
github.com/ghodss/yaml v1.0.0
Expand All @@ -12,7 +12,48 @@ require (
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
go.uber.org/goleak v1.1.12
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/sys v0.0.0-20220307203707-22a9840ba4d7
google.golang.org/grpc v1.42.0
)

require (
github.com/OneOfOne/xxhash v1.2.3 // indirect
github.com/antonfisher/nested-logrus-formatter v1.3.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/edwarnicke/grpcfd v1.1.2 // indirect
github.com/edwarnicke/serialize v1.0.7 // indirect
github.com/go-logr/logr v1.2.1 // indirect
github.com/go-logr/stdr v1.2.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/open-policy-agent/opa v0.16.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/stretchr/objx v0.1.1 // indirect
github.com/vishvananda/netlink v1.1.1-0.20220118170537-d6b03fdeb845 // indirect
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
github.com/yashtewari/glob-intersection v0.0.0-20180916065949-5c77d914dd0b // indirect
go.opentelemetry.io/otel v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.26.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.26.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0 // indirect
go.opentelemetry.io/otel/internal/metric v0.26.0 // indirect
go.opentelemetry.io/otel/metric v0.26.0 // indirect
go.opentelemetry.io/otel/sdk v1.3.0 // indirect
go.opentelemetry.io/otel/sdk/export/metric v0.26.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.26.0 // indirect
go.opentelemetry.io/otel/trace v1.3.0 // indirect
go.opentelemetry.io/proto/otlp v0.11.0 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
1 change: 1 addition & 0 deletions pkg/networkservice/chains/forwarder/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

// Package xconnectns provides an Endpoint implementing the SR-IOV Forwarder networks service
Expand Down
9 changes: 5 additions & 4 deletions pkg/networkservice/common/mechanisms/vfio/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -14,7 +14,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//+build !windows
//go:build !windows
// +build !windows

package vfio

Expand Down Expand Up @@ -42,8 +43,8 @@ type vfioClient struct {
}

const (
mkdirPerm = 0750
mknodPerm = 0666
mkdirPerm = 0o750
mknodPerm = 0o666
)

// NewClient returns a new VFIO client chain element
Expand Down
7 changes: 4 additions & 3 deletions pkg/networkservice/common/mechanisms/vfio/client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -14,7 +14,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//+build !windows
//go:build !windows
// +build !windows

package vfio_test

Expand Down Expand Up @@ -77,7 +78,7 @@ func TestVFIOClient_Request(t *testing.T) {
defer cancel()

tmpDir := filepath.Join(os.TempDir(), t.Name())
err := os.MkdirAll(tmpDir, 0750)
err := os.MkdirAll(tmpDir, 0o750)
require.NoError(t, err)
defer func() { _ = os.RemoveAll(tmpDir) }()

Expand Down
5 changes: 3 additions & 2 deletions pkg/networkservice/common/mechanisms/vfio/const.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -14,7 +14,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//+build !windows
//go:build !windows
// +build !windows

package vfio

Expand Down
5 changes: 3 additions & 2 deletions pkg/networkservice/common/mechanisms/vfio/option.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021 Doc.ai and/or its affiliates.
// Copyright (c) 2021-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -14,7 +14,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//+build !windows
//go:build !windows
// +build !windows

package vfio

Expand Down
5 changes: 3 additions & 2 deletions pkg/networkservice/common/mechanisms/vfio/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -14,7 +14,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//+build !windows
//go:build !windows
// +build !windows

// Package vfio provides server, vfioClient chain elements for the VFIO mechanism connection
package vfio
Expand Down
9 changes: 5 additions & 4 deletions pkg/networkservice/common/mechanisms/vfio/server_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -14,7 +14,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//+build !windows
//go:build !windows
// +build !windows

package vfio_test

Expand Down Expand Up @@ -101,9 +102,9 @@ func TestVFIOServer_Request(t *testing.T) {

notAllowed, allowed, wider := testCgroups(ctx, t, tmpDir)

err := unix.Mknod(filepath.Join(tmpDir, vfioDevice), unix.S_IFCHR|0666, int(unix.Mkdev(1, 2)))
err := unix.Mknod(filepath.Join(tmpDir, vfioDevice), unix.S_IFCHR|0o666, int(unix.Mkdev(1, 2)))
require.NoError(t, err)
err = unix.Mknod(filepath.Join(tmpDir, iommuGroupString), unix.S_IFCHR|0666, int(unix.Mkdev(3, 4)))
err = unix.Mknod(filepath.Join(tmpDir, iommuGroupString), unix.S_IFCHR|0o666, int(unix.Mkdev(3, 4)))
require.NoError(t, err)

conn, err := server.Request(ctx, &networkservice.NetworkServiceRequest{
Expand Down
5 changes: 3 additions & 2 deletions pkg/networkservice/common/resourcepool/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2021 Nordix Foundation.
// Copyright (c) 2021-2022 Nordix Foundation.
//
// Copyright (c) 2021 Doc.ai and/or its affiliates.
// Copyright (c) 2021-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -16,6 +16,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

package resourcepool
Expand Down
5 changes: 3 additions & 2 deletions pkg/networkservice/common/resourcepool/common.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2021 Nordix Foundation.
// Copyright (c) 2021-2022 Nordix Foundation.
//
// Copyright (c) 2021 Doc.ai and/or its affiliates.
// Copyright (c) 2021-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -16,6 +16,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

package resourcepool
Expand Down
3 changes: 2 additions & 1 deletion pkg/networkservice/common/resourcepool/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -14,6 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

// Package resourcepool provides chain elements for to select and free VF
Expand Down
5 changes: 3 additions & 2 deletions pkg/networkservice/common/resourcepool/server_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// Copyright (c) 2021 Nordix Foundation.
// Copyright (c) 2021-2022 Nordix Foundation.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -16,6 +16,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

package resourcepool_test
Expand Down
5 changes: 3 additions & 2 deletions pkg/networkservice/common/token/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// Copyright (c) 2021 Nordix Foundation.
// Copyright (c) 2021-2022 Nordix Foundation.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -16,6 +16,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

// Package token provides chain elements for inserting SRIOV tokens into request and response
Expand Down
5 changes: 3 additions & 2 deletions pkg/networkservice/common/token/multitoken/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// Copyright (c) 2021 Nordix Foundation.
// Copyright (c) 2021-2022 Nordix Foundation.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -16,6 +16,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

// Package multitoken provides chain elements for inserting SRIOV tokens into request and response
Expand Down
Loading