diff --git a/cache/blobs_nolinux.go b/cache/blobs_nolinux.go index 7283cbf0e..0c1c99efe 100644 --- a/cache/blobs_nolinux.go +++ b/cache/blobs_nolinux.go @@ -12,6 +12,6 @@ import ( "github.com/pkg/errors" ) -func (sr *immutableRef) tryComputeOverlayBlob(ctx context.Context, lower, upper []mount.Mount, mediaType string, ref string, compressorFunc compression.Compressor) (_ ocispecs.Descriptor, ok bool, err error) { +func (sr *immutableRef) tryComputeOverlayBlob(_ context.Context, _, _ []mount.Mount, _ string, _ string, _ compression.Compressor) (_ ocispecs.Descriptor, ok bool, err error) { return ocispecs.Descriptor{}, true, errors.Errorf("overlayfs-based diff computing is unsupported") } diff --git a/cache/contenthash/filehash_windows.go b/cache/contenthash/filehash_windows.go index a0e35665f..3913b9a56 100644 --- a/cache/contenthash/filehash_windows.go +++ b/cache/contenthash/filehash_windows.go @@ -9,6 +9,6 @@ import ( fstypes "github.com/tonistiigi/fsutil/types" ) -func setUnixOpt(path string, fi os.FileInfo, stat *fstypes.Stat) error { +func setUnixOpt(_ string, _ os.FileInfo, _ *fstypes.Stat) error { return nil } diff --git a/client/mergediff_nolinux_test.go b/client/mergediff_nolinux_test.go index 9686df425..18da8cd2b 100644 --- a/client/mergediff_nolinux_test.go +++ b/client/mergediff_nolinux_test.go @@ -10,13 +10,13 @@ import ( "github.com/pkg/errors" ) -func mkfifo(path string, mode os.FileMode) fstest.Applier { +func mkfifo(_ string, _ os.FileMode) fstest.Applier { return applyFn(func(string) error { return errors.New("mkfifo applier not implemented yet on this platform") }) } -func mkchardev(path string, mode os.FileMode, maj, min uint32) fstest.Applier { +func mkchardev(_ string, _ os.FileMode, _, _ uint32) fstest.Applier { return applyFn(func(string) error { return errors.New("mkchardev applier not implemented yet on this platform") }) diff --git a/cmd/buildkitd/main_windows.go b/cmd/buildkitd/main_windows.go index 5ca20a689..3b3c533c3 100644 --- a/cmd/buildkitd/main_windows.go +++ b/cmd/buildkitd/main_windows.go @@ -15,7 +15,7 @@ import ( const socketScheme = "npipe://" -func listenFD(addr string, tlsConfig *tls.Config) (net.Listener, error) { +func listenFD(_ string, _ *tls.Config) (net.Listener, error) { return nil, errors.New("listening server on fd not supported on windows") } diff --git a/executor/containerdexecutor/executor_windows.go b/executor/containerdexecutor/executor_windows.go index 1148b0388..1155a1b0e 100644 --- a/executor/containerdexecutor/executor_windows.go +++ b/executor/containerdexecutor/executor_windows.go @@ -19,13 +19,13 @@ import ( "github.com/pkg/errors" ) -func getUserSpec(user, rootfsPath string) (specs.User, error) { +func getUserSpec(user, _ string) (specs.User, error) { return specs.User{ Username: user, }, nil } -func (w *containerdExecutor) prepareExecutionEnv(ctx context.Context, rootMount executor.Mount, mounts []executor.Mount, meta executor.Meta, details *containerState, netMode pb.NetMode) (string, string, func(), error) { +func (w *containerdExecutor) prepareExecutionEnv(ctx context.Context, rootMount executor.Mount, _ []executor.Mount, _ executor.Meta, details *containerState, _ pb.NetMode) (string, string, func(), error) { var releasers []func() error releaseAll := func() { for _, release := range releasers { @@ -75,7 +75,7 @@ func (w *containerdExecutor) ensureCWD(ctx context.Context, details *containerSt return nil } -func (w *containerdExecutor) createOCISpec(ctx context.Context, id, resolvConf, hostsFile string, namespace network.Namespace, mounts []executor.Mount, meta executor.Meta, details *containerState) (*specs.Spec, func(), error) { +func (w *containerdExecutor) createOCISpec(ctx context.Context, id, _, _ string, namespace network.Namespace, mounts []executor.Mount, meta executor.Meta, _ *containerState) (*specs.Spec, func(), error) { var releasers []func() releaseAll := func() { for _, release := range releasers { diff --git a/executor/oci/spec_windows.go b/executor/oci/spec_windows.go index 6f1436fd7..9c23dab47 100644 --- a/executor/oci/spec_windows.go +++ b/executor/oci/spec_windows.go @@ -51,14 +51,14 @@ func withGetUserInfoMount() oci.SpecOpts { } } -func generateMountOpts(resolvConf, hostsFile string) ([]oci.SpecOpts, error) { +func generateMountOpts(_, _ string) ([]oci.SpecOpts, error) { return []oci.SpecOpts{ withGetUserInfoMount(), }, nil } // generateSecurityOpts may affect mounts, so must be called after generateMountOpts -func generateSecurityOpts(mode pb.SecurityMode, apparmorProfile string, selinuxB bool) ([]oci.SpecOpts, error) { +func generateSecurityOpts(mode pb.SecurityMode, _ string, _ bool) ([]oci.SpecOpts, error) { if mode == pb.SecurityMode_INSECURE { return nil, errors.New("no support for running in insecure mode on Windows") } diff --git a/executor/runcexecutor/executor.go b/executor/runcexecutor/executor.go index 141767f8b..c4a70ea37 100644 --- a/executor/runcexecutor/executor.go +++ b/executor/runcexecutor/executor.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + package runcexecutor import ( diff --git a/executor/runcexecutor/executor_common.go b/executor/runcexecutor/executor_common.go new file mode 100644 index 000000000..024dc4fa0 --- /dev/null +++ b/executor/runcexecutor/executor_common.go @@ -0,0 +1 @@ +package runcexecutor diff --git a/snapshot/diffapply_windows.go b/snapshot/diffapply_windows.go index 2ec9fc3d7..d85ec70b0 100644 --- a/snapshot/diffapply_windows.go +++ b/snapshot/diffapply_windows.go @@ -11,10 +11,10 @@ import ( "github.com/pkg/errors" ) -func (sn *mergeSnapshotter) diffApply(ctx context.Context, dest Mountable, diffs ...Diff) (_ snapshots.Usage, rerr error) { +func (sn *mergeSnapshotter) diffApply(_ context.Context, _ Mountable, _ ...Diff) (_ snapshots.Usage, rerr error) { return snapshots.Usage{}, errors.New("diffApply not yet supported on windows") } -func needsUserXAttr(ctx context.Context, sn Snapshotter, lm leases.Manager) (bool, error) { +func needsUserXAttr(_ context.Context, _ Snapshotter, _ leases.Manager) (bool, error) { return false, errors.New("needs userxattr not supported on windows") } diff --git a/solver/llbsolver/ops/user_windows.go b/solver/llbsolver/ops/user_windows.go index 553a2d210..1164a8fdb 100644 --- a/solver/llbsolver/ops/user_windows.go +++ b/solver/llbsolver/ops/user_windows.go @@ -18,7 +18,7 @@ func getReadUserFn(worker worker.Worker) func(chopt *pb.ChownOpt, mu, mg snapsho } } -func readUser(chopt *pb.ChownOpt, mu, mg snapshot.Mountable, worker worker.Worker) (*copy.User, error) { +func readUser(chopt *pb.ChownOpt, mu, _ snapshot.Mountable, worker worker.Worker) (*copy.User, error) { if chopt == nil { return nil, nil } diff --git a/util/archutil/check_windows.go b/util/archutil/check_windows.go index 736f2216b..76c27fbb2 100644 --- a/util/archutil/check_windows.go +++ b/util/archutil/check_windows.go @@ -7,6 +7,6 @@ import ( "errors" ) -func check(arch, bin string) (string, error) { +func check(_, _ string) (string, error) { return "", errors.New("binfmt is not supported on Windows") } diff --git a/util/network/cniprovider/createns_windows.go b/util/network/cniprovider/createns_windows.go index f294d64d4..093aed7b3 100644 --- a/util/network/cniprovider/createns_windows.go +++ b/util/network/cniprovider/createns_windows.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" ) -func createNetNS(_ *cniProvider, id string) (string, error) { +func createNetNS(_ *cniProvider, _ string) (string, error) { nsTemplate := hcn.NewNamespace(hcn.NamespaceTypeGuest) ns, err := nsTemplate.Create() if err != nil { @@ -34,7 +34,7 @@ func setNetNS(s *specs.Spec, nativeID string) error { return nil } -func unmountNetNS(nativeID string) error { +func unmountNetNS(_ string) error { // We don't need to unmount the NS. return nil } diff --git a/util/network/netproviders/network_nobridge.go b/util/network/netproviders/network_nobridge.go index 8941e29da..1edde9b38 100644 --- a/util/network/netproviders/network_nobridge.go +++ b/util/network/netproviders/network_nobridge.go @@ -11,6 +11,6 @@ import ( "github.com/pkg/errors" ) -func getBridgeProvider(opt cniprovider.Opt) (network.Provider, error) { +func getBridgeProvider(_ cniprovider.Opt) (network.Provider, error) { return nil, errors.Errorf("bridge network is not supported on %s yet", runtime.GOOS) } diff --git a/util/testutil/workers/util_windows.go b/util/testutil/workers/util_windows.go index 8d95f04ef..1a55bad9e 100644 --- a/util/testutil/workers/util_windows.go +++ b/util/testutil/workers/util_windows.go @@ -35,11 +35,11 @@ func getContainerdDebugSock(tmpdir string) string { } // no-op for parity with unix -func mountInfo(tmpdir string) error { +func mountInfo(_ string) error { return nil } -func chown(name string, uid, gid int) error { +func chown(_ string, _, _ int) error { // Chown not supported on Windows return nil } diff --git a/worker/runc/runc.go b/worker/runc/runc.go index 974dfab3a..2b22a7277 100644 --- a/worker/runc/runc.go +++ b/worker/runc/runc.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + package runc import (