Skip to content

Commit

Permalink
runtime: go fix code for 1.19
Browse files Browse the repository at this point in the history
We have starting to use golang 1.19, some features are
not supported later, so run `go fix` to fix them.

Fixes: kata-containers#5750

Signed-off-by: Bin Liu <[email protected]>
  • Loading branch information
liubin committed Nov 25, 2022
1 parent f02bb1a commit 1dfd845
Show file tree
Hide file tree
Showing 43 changed files with 4 additions and 43 deletions.
1 change: 0 additions & 1 deletion src/runtime/cmd/kata-runtime/kata-check_generic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//

//go:build arm64 || ppc64le
// +build arm64 ppc64le

package main

Expand Down
1 change: 0 additions & 1 deletion src/runtime/cmd/kata-runtime/kata-env_generic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//

//go:build arm64 || ppc64le
// +build arm64 ppc64le

package main

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ require (
go.opentelemetry.io/otel/exporters/jaeger v1.0.0
go.opentelemetry.io/otel/sdk v1.3.0
go.opentelemetry.io/otel/trace v1.3.0
golang.org/x/net v0.0.0-20220722155237-a158d28d115b
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
google.golang.org/grpc v1.47.0
Expand Down Expand Up @@ -99,6 +98,7 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
go.mongodb.org/mongo-driver v1.7.5 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
1 change: 0 additions & 1 deletion src/runtime/pkg/govmm/qemu/qemu_arch_base_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !s390x
// +build !s390x

// Copyright contributors to the Virtual Machine Manager for Go project
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/pkg/resourcecontrol/cgroups.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2021-2022 Apple Inc.
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/acrn.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2019 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/acrn_arch_base.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2019 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/acrn_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2019 Intel Corporation
//
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/virtcontainers/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"syscall"
"time"

"context"
persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api"
pbTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols"
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols/grpc"
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types"
specs "github.com/opencontainers/runtime-spec/specs-go"
"golang.org/x/net/context"
)

type newAgentFuncKey struct{}
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/clh.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2019 Ericsson Eurolab Deutschland GmbH
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/clh_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2019 Ericsson Eurolab Deutschland G.m.b.H.
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/fc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/fc_metrics.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2020 Ant Group
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/fc_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2019 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/ipvlan_endpoint.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/ipvlan_endpoint_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/virtcontainers/kata_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import (
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types"
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/utils"

"context"
"github.com/gogo/protobuf/proto"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"golang.org/x/sys/unix"
"google.golang.org/grpc/codes"
grpcStatus "google.golang.org/grpc/status"
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/macvlan_endpoint.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/macvlan_endpoint_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/macvtap_endpoint.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/macvtap_endpoint_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/virtcontainers/mock_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"syscall"
"time"

"context"
persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api"
pbTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols"
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols/grpc"
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types"
specs "github.com/opencontainers/runtime-spec/specs-go"
"golang.org/x/net/context"
)

// mockAgent is an empty Agent implementation, for testing and
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/physical_endpoint.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/physical_endpoint_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2016 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_amd64_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_arch_base.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_arch_base_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_arm64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_arm64_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 IBM
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_ppc64le.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 IBM
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_ppc64le_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 IBM
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_s390x.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 IBM
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_s390x_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 IBM
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/qemu_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2016 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/tap_endpoint.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Huawei Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/tuntap_endpoint.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Huawei Corporation
// Copyright (c) 2019 Intel Corporation
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/utils/utils_linux_generic.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build amd64 || arm64 || s390x || !ppc64le
// +build amd64 arm64 s390x !ppc64le

// Copyright (c) 2019 IBM
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/veth_endpoint.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/veth_endpoint_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/vhostuser_endpoint.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down
1 change: 0 additions & 1 deletion src/runtime/virtcontainers/vhostuser_endpoint_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright (c) 2018 Intel Corporation
//
Expand Down

0 comments on commit 1dfd845

Please sign in to comment.