diff --git a/api/types/volume/cluster_volume.go b/api/types/volume/cluster_volume.go index 8801784664..bbd9ff0b8f 100644 --- a/api/types/volume/cluster_volume.go +++ b/api/types/volume/cluster_volume.go @@ -238,13 +238,13 @@ type TopologyRequirement struct { // If requisite is specified, all topologies in preferred list MUST // also be present in the list of requisite topologies. // - // If the SP is unable to to make the provisioned volume available + // If the SP is unable to make the provisioned volume available // from any of the preferred topologies, the SP MAY choose a topology // from the list of requisite topologies. // If the list of requisite topologies is not specified, then the SP // MAY choose from the list of all possible topologies. // If the list of requisite topologies is specified and the SP is - // unable to to make the provisioned volume available from any of the + // unable to make the provisioned volume available from any of the // requisite topologies it MUST fail the CreateVolume call. // // Example 1: diff --git a/cmd/docker-proxy/network_proxy_test.go b/cmd/docker-proxy/network_proxy_test.go index 01e87374d5..48c7a1abf7 100644 --- a/cmd/docker-proxy/network_proxy_test.go +++ b/cmd/docker-proxy/network_proxy_test.go @@ -15,7 +15,7 @@ import ( ) var ( - testBuf = []byte("Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo") + testBuf = []byte("Buffalo1 buffalo2 Buffalo3 buffalo4 buffalo5 buffalo6 Buffalo7 buffalo8") testBufSize = len(testBuf) ) diff --git a/container/attach_context.go b/container/attach_context.go index 5a7d0748f0..9dd8e9da41 100644 --- a/container/attach_context.go +++ b/container/attach_context.go @@ -5,7 +5,7 @@ import ( "sync" ) -// attachContext is the context used for for attach calls. +// attachContext is the context used for attach calls. type attachContext struct { mu sync.Mutex ctx context.Context diff --git a/daemon/daemon_linux_test.go b/daemon/daemon_linux_test.go index 0bf550d168..b6e3125eb2 100644 --- a/daemon/daemon_linux_test.go +++ b/daemon/daemon_linux_test.go @@ -20,6 +20,7 @@ import ( is "gotest.tools/v3/assert/cmp" ) +//nolint:dupword const mountsFixture = `142 78 0:38 / / rw,relatime - aufs none rw,si=573b861da0b3a05b,dio 143 142 0:60 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw 144 142 0:67 / /dev rw,nosuid - tmpfs tmpfs rw,mode=755 @@ -58,6 +59,7 @@ const mountsFixture = `142 78 0:38 / / rw,relatime - aufs none rw,si=573b861da0b 310 142 0:60 / /run/docker/netns/71a18572176b rw,nosuid,nodev,noexec,relatime - proc proc rw ` +//nolint:dupword const mountsFixtureOverlay2 = `23 28 0:22 / /sys rw,nosuid,nodev,noexec,relatime shared:7 - sysfs sysfs rw 24 28 0:4 / /proc rw,nosuid,nodev,noexec,relatime shared:13 - proc proc rw 25 28 0:6 / /dev rw,nosuid,relatime shared:2 - devtmpfs udev rw,size=491380k,nr_inodes=122845,mode=755 diff --git a/daemon/kill.go b/daemon/kill.go index 770a769c22..420fdfedb5 100644 --- a/daemon/kill.go +++ b/daemon/kill.go @@ -111,7 +111,7 @@ func (daemon *Daemon) killWithSignal(container *containerpkg.Container, stopSign // We need to clean up this container but it is possible there is a case where we hit here before the exit event is processed // but after it was fired off. // So let's wait the container's stop timeout amount of time to see if the event is eventually processed. - // Doing this has the side effect that if no event was ever going to come we are waiting a a longer period of time uneccessarily. + // Doing this has the side effect that if no event was ever going to come we are waiting a longer period of time unnecessarily. // But this prevents race conditions in processing the container. ctx, cancel := context.WithTimeout(context.TODO(), time.Duration(container.StopTimeout())*time.Second) defer cancel() diff --git a/daemon/logger/loggerutils/follow.go b/daemon/logger/loggerutils/follow.go index 106101937a..6131bcea7c 100644 --- a/daemon/logger/loggerutils/follow.go +++ b/daemon/logger/loggerutils/follow.go @@ -108,7 +108,7 @@ func (fl *follow) nextPos(current logPos) (next logPos, ok bool) { case st = <-fl.LogFile.read: } - // Have any any logs been written since we last checked? + // Have any logs been written since we last checked? if st.pos == current { // Nope. // Add ourself to the notify list. st.wait = append(st.wait, fl.c) diff --git a/daemon/logger/loggerutils/logfile.go b/daemon/logger/loggerutils/logfile.go index 572a3a7952..61490c8d1a 100644 --- a/daemon/logger/loggerutils/logfile.go +++ b/daemon/logger/loggerutils/logfile.go @@ -59,7 +59,7 @@ type LogFile struct { // passing along ownership is expressed with function argument types. // Methods which take a pointer *logReadState argument borrow the state, // analogous to functions which require a lock to be held when calling. - // The caller retains ownership. Calling a method which which takes a + // The caller retains ownership. Calling a method which takes a // value logFileState argument gives ownership to the callee. read chan logReadState diff --git a/daemon/logger/ring.go b/daemon/logger/ring.go index ff43baac2f..8c19b543d6 100644 --- a/daemon/logger/ring.go +++ b/daemon/logger/ring.go @@ -138,7 +138,7 @@ type messageRing struct { wait *sync.Cond sizeBytes int64 // current buffer size - maxBytes int64 // max buffer size size + maxBytes int64 // max buffer size queue []*Message closed bool } diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index 03f7db7397..858d496b40 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -304,6 +304,7 @@ func (s *DockerCLIBuildSuite) TestBuildOnBuildLowercase(c *testing.T) { c.Fatalf("Did not receive the expected echo text, got %s", result.Combined()) } + //nolint:dupword if strings.Contains(result.Combined(), "ONBUILD ONBUILD") { c.Fatalf("Got an ONBUILD ONBUILD error with no error: got %s", result.Combined()) } @@ -2136,14 +2137,14 @@ func (s *DockerCLIBuildSuite) TestBuildWithVolumeOwnership(c *testing.T) { const name = "testbuildimg" buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox:latest - RUN mkdir /test && chown daemon:daemon /test && chmod 0600 /test + RUN mkdir /test && chown daemon:wheel /test && chmod 0600 /test VOLUME /test`)) out := cli.DockerCmd(c, "run", "--rm", "testbuildimg", "ls", "-la", "/test").Combined() if expected := "drw-------"; !strings.Contains(out, expected) { c.Fatalf("expected %s received %s", expected, out) } - if expected := "daemon daemon"; !strings.Contains(out, expected) { + if expected := "daemon wheel"; !strings.Contains(out, expected) { c.Fatalf("expected %s received %s", expected, out) } } @@ -5613,7 +5614,8 @@ func (s *DockerCLIBuildSuite) TestBuildWithExtraHostInvalidFormat(c *testing.T) } func (s *DockerCLIBuildSuite) TestBuildMultiStageCopyFromSyntax(c *testing.T) { - dockerfile := ` + //nolint:dupword + const dockerfile = ` FROM busybox AS first COPY foo bar @@ -5992,6 +5994,7 @@ func (s *DockerCLIBuildSuite) TestBuildOpaqueDirectory(c *testing.T) { func (s *DockerCLIBuildSuite) TestBuildWindowsUser(c *testing.T) { testRequires(c, DaemonIsWindows) const name = "testbuildwindowsuser" + //nolint:dupword buildImage(name, build.WithDockerfile(`FROM `+testEnv.PlatformDefaults.BaseImage+` RUN net user user /add USER user @@ -6155,7 +6158,7 @@ func (s *DockerCLIBuildSuite) TestBuildIidFile(c *testing.T) { // Use a Dockerfile with multiple stages to ensure we get the last one cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` AS stage1 -ENV FOO FOO +ENV FOO FOO1 FROM `+minimalBaseImage()+` ENV BAR BAZ`), cli.WithFlags("--iidfile", tmpIidFile)) diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index f54ac3b606..5b9260216b 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -807,6 +807,8 @@ func (s *DockerDaemonSuite) TestDaemonICCPing(c *testing.T) { // // pkts bytes target prot opt in out source destination // 0 0 DROP all -- ext-bridge5 ext-bridge5 anywhere anywhere + // + //nolint:dupword cols := strings.Fields(out) expected := []string{"0", "0", "DROP", "all", "--", bridgeName, bridgeName, "anywhere", "anywhere"} @@ -856,6 +858,8 @@ func (s *DockerDaemonSuite) TestDaemonICCLinkExpose(c *testing.T) { // // pkts bytes target prot opt in out source destination // 0 0 DROP all -- ext-bridge6 ext-bridge6 anywhere anywhere + // + //nolint:dupword cols := strings.Fields(out) expected := []string{"0", "0", "DROP", "all", "--", bridgeName, bridgeName, "anywhere", "anywhere"} @@ -2544,7 +2548,7 @@ func (s *DockerDaemonSuite) TestExecWithUserAfterLiveRestore(c *testing.T) { testRequires(c, DaemonIsLinux) s.d.StartWithBusybox(testutil.GetContext(c), c, "--live-restore") - out, err := s.d.Cmd("run", "--init", "-d", "--name=top", "busybox", "sh", "-c", "addgroup -S test && adduser -S -G test test -D -s /bin/sh && touch /adduser_end && exec top") + out, err := s.d.Cmd("run", "--init", "-d", "--name=top", "busybox", "sh", "-c", "addgroup -S testgroup && adduser -S -G testgroup test -D -s /bin/sh && touch /adduser_end && exec top") assert.NilError(c, err, "Output: %s", out) s.d.WaitRun("top") @@ -2554,7 +2558,7 @@ func (s *DockerDaemonSuite) TestExecWithUserAfterLiveRestore(c *testing.T) { assert.Assert(c, err == nil, "Timeout waiting for shell command to be completed") out1, err := s.d.Cmd("exec", "-u", "test", "top", "id") - // uid=100(test) gid=101(test) groups=101(test) + // uid=100(test) gid=101(testgroup) groups=101(testgroup) assert.Assert(c, err == nil, "Output: %s", out1) // restart daemon. diff --git a/integration-cli/docker_cli_plugins_logdriver_test.go b/integration-cli/docker_cli_plugins_logdriver_test.go index 2bb80e3b8c..500222f024 100644 --- a/integration-cli/docker_cli_plugins_logdriver_test.go +++ b/integration-cli/docker_cli_plugins_logdriver_test.go @@ -35,7 +35,7 @@ func (s *DockerCLIPluginLogDriverSuite) TestPluginLogDriver(c *testing.T) { cli.DockerCmd(c, "start", "-a", "test") out = cli.DockerCmd(c, "logs", "test").Combined() - assert.Equal(c, strings.TrimSpace(out), "hello\nhello") + assert.Equal(c, strings.TrimSpace(out), "hello\nhello") //nolint:dupword cli.DockerCmd(c, "rm", "test") cli.DockerCmd(c, "plugin", "disable", pluginName) diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index 11276ffc1f..8ddce7b4aa 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -503,7 +503,7 @@ func (s *DockerCLIRunSuite) TestVolumesFromGetsProperMode(c *testing.T) { cli.DockerCmd(c, "run", "--name", "parent", "-v", hostpath+":"+prefix+slash+"test:ro", "busybox", "true") - // Expect this "rw" mode to be be ignored since the inherited volume is "ro" + // Expect this "rw" mode to be ignored since the inherited volume is "ro" if _, _, err := dockerCmdWithError("run", "--volumes-from", "parent:rw", "busybox", "touch", prefix+slash+"test"+slash+"file"); err == nil { c.Fatal("Expected volumes-from to inherit read-only volume even when passing in `rw`") } @@ -4412,7 +4412,7 @@ func (s *DockerCLIRunSuite) TestRunMount(c *testing.T) { func (s *DockerCLIRunSuite) TestRunHostnameFQDN(c *testing.T) { testRequires(c, DaemonIsLinux) - expectedOutput := "foobar.example.com\nfoobar.example.com\nfoobar\nexample.com\nfoobar.example.com" + expectedOutput := "foobar.example.com\nfoobar.example.com\nfoobar\nexample.com\nfoobar.example.com" //nolint:dupword out := cli.DockerCmd(c, "run", "--hostname=foobar.example.com", "busybox", "sh", "-c", `cat /etc/hostname && hostname && hostname -s && hostname -d && hostname -f`).Combined() assert.Equal(c, strings.TrimSpace(out), expectedOutput) @@ -4425,7 +4425,7 @@ func (s *DockerCLIRunSuite) TestRunHostnameFQDN(c *testing.T) { func (s *DockerCLIRunSuite) TestRunHostnameInHostMode(c *testing.T) { testRequires(c, DaemonIsLinux, NotUserNamespace) - const expectedOutput = "foobar\nfoobar" + const expectedOutput = "foobar\nfoobar" //nolint:dupword out := cli.DockerCmd(c, "run", "--net=host", "--hostname=foobar", "busybox", "sh", "-c", `echo $HOSTNAME && hostname`).Combined() assert.Equal(c, strings.TrimSpace(out), expectedOutput) } diff --git a/integration-cli/docker_cli_service_logs_test.go b/integration-cli/docker_cli_service_logs_test.go index 150f5075be..f4d549ce05 100644 --- a/integration-cli/docker_cli_service_logs_test.go +++ b/integration-cli/docker_cli_service_logs_test.go @@ -91,7 +91,7 @@ func (s *DockerSwarmSuite) TestServiceLogsCompleteness(c *testing.T) { lines := strings.Split(strings.TrimSpace(out), "\n") // i have heard anecdotal reports that logs may come back from the engine - // mis-ordered. if this tests fails, consider the possibility that that + // mis-ordered. if this tests fails, consider the possibility that // might be occurring for i, line := range lines { assert.Assert(c, strings.Contains(line, fmt.Sprintf("log test %v", i))) diff --git a/integration/container/health_test.go b/integration/container/health_test.go index 9444bfa9ba..807c486020 100644 --- a/integration/container/health_test.go +++ b/integration/container/health_test.go @@ -99,13 +99,13 @@ func TestHealthCheckProcessKilled(t *testing.T) { cID := container.Run(ctx, t, apiClient, func(c *container.TestContainerConfig) { c.Config.Healthcheck = &containertypes.HealthConfig{ - Test: []string{"CMD", "sh", "-c", `echo "logs logs logs"; sleep 60`}, + Test: []string{"CMD", "sh", "-c", `echo "logs1 logs2 logs3"; sleep 60`}, Interval: 100 * time.Millisecond, Timeout: 50 * time.Millisecond, Retries: 1, } }) - poll.WaitOn(t, pollForHealthCheckLog(ctx, apiClient, cID, "Health check exceeded timeout (50ms): logs logs logs\n")) + poll.WaitOn(t, pollForHealthCheckLog(ctx, apiClient, cID, "Health check exceeded timeout (50ms): logs1 logs2 logs3\n")) } func TestHealthStartInterval(t *testing.T) { diff --git a/integration/container/ipcmode_linux_test.go b/integration/container/ipcmode_linux_test.go index bcd12e883e..cf4d207100 100644 --- a/integration/container/ipcmode_linux_test.go +++ b/integration/container/ipcmode_linux_test.go @@ -28,6 +28,8 @@ import ( // 29 23 0:24 / /dev/shm rw,nosuid,nodev shared:4 - tmpfs tmpfs rw // ^^^^\ // - this is the minor:major we look for +// +//nolint:dupword func testIpcCheckDevExists(mm string) (bool, error) { f, err := os.Open("/proc/self/mountinfo") if err != nil { diff --git a/integration/image/list_test.go b/integration/image/list_test.go index 88a89b7060..b653802491 100644 --- a/integration/image/list_test.go +++ b/integration/image/list_test.go @@ -65,7 +65,7 @@ func TestImagesFilterUntil(t *testing.T) { imgs := make([]string, 5) for i := range imgs { if i > 0 { - // Make really really sure each image has a distinct timestamp. + // Make sure each image has a distinct timestamp. time.Sleep(time.Millisecond) } id, err := client.ContainerCommit(ctx, ctr, containertypes.CommitOptions{Reference: fmt.Sprintf("%s:v%d", name, i)}) @@ -109,7 +109,7 @@ func TestImagesFilterBeforeSince(t *testing.T) { imgs := make([]string, 5) for i := range imgs { if i > 0 { - // Make really really sure each image has a distinct timestamp. + // Make sure each image has a distinct timestamp. time.Sleep(time.Millisecond) } id, err := client.ContainerCommit(ctx, ctr, containertypes.CommitOptions{Reference: fmt.Sprintf("%s:v%d", name, i)}) diff --git a/integration/image/remove_unix_test.go b/integration/image/remove_unix_test.go index 06d3983047..92cbc13b1e 100644 --- a/integration/image/remove_unix_test.go +++ b/integration/image/remove_unix_test.go @@ -63,7 +63,7 @@ func TestRemoveImageGarbageCollector(t *testing.T) { // Build a image with multiple layers dockerfile := `FROM busybox - RUN echo echo Running... > /run.sh` + RUN echo 'echo Running...'' > /run.sh` source := fakecontext.New(t, "", fakecontext.WithDockerfile(dockerfile)) defer source.Close() resp, err := client.ImageBuild(ctx, diff --git a/integration/service/create_test.go b/integration/service/create_test.go index a6c8ce0067..aff1a29a42 100644 --- a/integration/service/create_test.go +++ b/integration/service/create_test.go @@ -118,7 +118,7 @@ func TestCreateServiceMultipleTimes(t *testing.T) { assert.NilError(t, err) // we can't just wait on no tasks for the service, counter-intuitively. - // Tasks may briefly exist but not show up, if they are are in the process + // Tasks may briefly exist but not show up, if they are in the process // of being deallocated. To avoid this case, we should retry network remove // a few times, to give tasks time to be deallcoated poll.WaitOn(t, swarm.NoTasksForService(ctx, client, serviceID2), swarm.ServicePoll) diff --git a/integration/volume/mount_test.go b/integration/volume/mount_test.go index 21e1186523..1c6b4cd507 100644 --- a/integration/volume/mount_test.go +++ b/integration/volume/mount_test.go @@ -45,7 +45,7 @@ func TestRunMountVolumeSubdir(t *testing.T) { {name: "not existing", opts: mount.VolumeOptions{Subpath: "not-existing-path"}, cmd: []string{"cat", "/volume"}, startErr: (&safepath.ErrNotAccessible{}).Error()}, {name: "mount link", opts: mount.VolumeOptions{Subpath: filepath.Join("hack", "root")}, cmd: []string{"ls", "/volume"}, startErr: (&safepath.ErrEscapesBase{}).Error()}, - {name: "mount link link", opts: mount.VolumeOptions{Subpath: filepath.Join("hack", "bad")}, cmd: []string{"ls", "/volume"}, startErr: (&safepath.ErrEscapesBase{}).Error()}, + {name: "mount link link", opts: mount.VolumeOptions{Subpath: filepath.Join("hack", "bad")}, cmd: []string{"ls", "/volume"}, startErr: (&safepath.ErrEscapesBase{}).Error()}, //nolint:dupword } { t.Run(tc.name, func(t *testing.T) { if tc.skipPlatform != "" { diff --git a/internal/safepath/k8s_safeopen_linux.go b/internal/safepath/k8s_safeopen_linux.go index ec7c9ed59e..ebbe7e17a5 100644 --- a/internal/safepath/k8s_safeopen_linux.go +++ b/internal/safepath/k8s_safeopen_linux.go @@ -29,7 +29,7 @@ import ( // kubernetesSafeOpen open path formed by concatenation of the base directory // and its subpath and return its fd. -// Symlinks are disallowed (pathname must already resolve symlinks) and the path +// Symlinks are disallowed (pathname must already resolve symlinks) and the // path must be within the base directory. // This is minimally modified code from https://github.com/kubernetes/kubernetes/blob/55fb1805a1217b91b36fa8fe8f2bf3a28af2454d/pkg/volume/util/subpath/subpath_linux.go#L530 func kubernetesSafeOpen(base, subpath string) (int, error) { diff --git a/libnetwork/cmd/networkdb-test/dbclient/ndbClient.go b/libnetwork/cmd/networkdb-test/dbclient/ndbClient.go index f993190537..1c0704ded7 100644 --- a/libnetwork/cmd/networkdb-test/dbclient/ndbClient.go +++ b/libnetwork/cmd/networkdb-test/dbclient/ndbClient.go @@ -786,7 +786,7 @@ func Client(args []string) { time.Sleep(1 * time.Hour) os.Exit(0) case "fail": - log.G(context.TODO()).Fatalf("Test error condition with message: error error error") + log.G(context.TODO()).Fatalf("Test error condition with message: error error error") //nolint:dupword } serviceName := args[1] diff --git a/libnetwork/drivers/bridge/errors.go b/libnetwork/drivers/bridge/errors.go index 11532d240e..20aacc797e 100644 --- a/libnetwork/drivers/bridge/errors.go +++ b/libnetwork/drivers/bridge/errors.go @@ -74,7 +74,7 @@ func (enip *ErrNoIPAddr) Error() string { // InternalError denotes the type of this error func (enip *ErrNoIPAddr) InternalError() {} -// ErrInvalidGateway is returned when the user provided default gateway (v4/v6) is not not valid. +// ErrInvalidGateway is returned when the user provided default gateway (v4/v6) is not valid. type ErrInvalidGateway struct{} func (eig *ErrInvalidGateway) Error() string { diff --git a/libnetwork/drivers/ipvlan/ipvlan_network.go b/libnetwork/drivers/ipvlan/ipvlan_network.go index 1121c68bf7..11bde5a3fd 100644 --- a/libnetwork/drivers/ipvlan/ipvlan_network.go +++ b/libnetwork/drivers/ipvlan/ipvlan_network.go @@ -157,7 +157,7 @@ func (d *driver) DeleteNetwork(nid string) error { // delete the network record from persistent cache err := d.storeDelete(n.config) if err != nil { - return fmt.Errorf("error deleting deleting id %s from datastore: %v", nid, err) + return fmt.Errorf("error deleting id %s from datastore: %v", nid, err) } return nil } diff --git a/libnetwork/drivers/macvlan/macvlan_network.go b/libnetwork/drivers/macvlan/macvlan_network.go index 6f02ee8d67..77aa323ecb 100644 --- a/libnetwork/drivers/macvlan/macvlan_network.go +++ b/libnetwork/drivers/macvlan/macvlan_network.go @@ -147,7 +147,7 @@ func (d *driver) DeleteNetwork(nid string) error { // delete the network record from persistent cache err := d.storeDelete(n.config) if err != nil { - return fmt.Errorf("error deleting deleting id %s from datastore: %v", nid, err) + return fmt.Errorf("error deleting id %s from datastore: %v", nid, err) } return nil } diff --git a/libnetwork/drivers/overlay/ov_network.go b/libnetwork/drivers/overlay/ov_network.go index 15ad20d2e6..66d4a44ed6 100644 --- a/libnetwork/drivers/overlay/ov_network.go +++ b/libnetwork/drivers/overlay/ov_network.go @@ -64,7 +64,7 @@ func init() { // Lock main() to the initial thread to exclude the goroutines executing // func setDefaultVLAN() from being scheduled onto that thread. Changes to // the network namespace of the initial thread alter /proc/self/ns/net, - // which would break any code which (incorrectly) assumes that that file is + // which would break any code which (incorrectly) assumes that the file is // a handle to the network namespace for the thread it is currently // executing on. runtime.LockOSThread() diff --git a/libnetwork/internal/caller/caller.go b/libnetwork/internal/caller/caller.go index 1634ffc6b3..0f33a5433b 100644 --- a/libnetwork/internal/caller/caller.go +++ b/libnetwork/internal/caller/caller.go @@ -22,8 +22,8 @@ func callerInfo(i int) string { return fName } -// Name returns the name of the function at the specified level -// level == 0 means current method name +// Name returns the name of the function at the specified level. +// (level == 0 means current method name). func Name(level int) string { return callerInfo(2 + level) } diff --git a/libnetwork/ipams/null/null.go b/libnetwork/ipams/null/null.go index 1ca4a7f51c..9e596843b8 100644 --- a/libnetwork/ipams/null/null.go +++ b/libnetwork/ipams/null/null.go @@ -34,7 +34,7 @@ func (a *allocator) RequestPool(addressSpace, requestedPool, requestedSubPool st return "", nil, nil, types.InvalidParameterErrorf("null ipam driver does not handle specific address subpool requests") } if v6 { - return "", nil, nil, types.InvalidParameterErrorf("null ipam driver does not handle IPv6 address pool pool requests") + return "", nil, nil, types.InvalidParameterErrorf("null ipam driver does not handle IPv6 address pool requests") } return defaultPoolID, defaultPool, nil, nil } diff --git a/libnetwork/osl/namespace_linux.go b/libnetwork/osl/namespace_linux.go index a00075cfa4..fb6cd13492 100644 --- a/libnetwork/osl/namespace_linux.go +++ b/libnetwork/osl/namespace_linux.go @@ -32,7 +32,7 @@ func init() { // by func (*Namespace) InvokeFunc() or func setIPv6() below from // being scheduled onto that thread. Changes to the network namespace of // the initial thread alter /proc/self/ns/net, which would break any - // code which (incorrectly) assumes that that file is the network + // code which (incorrectly) assumes that the file is the network // namespace for the thread it is currently executing on. runtime.LockOSThread() } diff --git a/pkg/chrootarchive/archive_unix_test.go b/pkg/chrootarchive/archive_unix_test.go index e0ab69780a..8a4f1938d3 100644 --- a/pkg/chrootarchive/archive_unix_test.go +++ b/pkg/chrootarchive/archive_unix_test.go @@ -36,7 +36,7 @@ func TestUntarWithMaliciousSymlinks(t *testing.T) { err = os.WriteFile(filepath.Join(dir, "host-file"), []byte("I am a host file"), 0o644) assert.NilError(t, err) - // Create some data which which will be copied into the "container" root into + // Create some data to copy into the "container" root into // the symlinked path. // Before this change, the copy would overwrite the "host" content. // With this change it should not. diff --git a/pkg/namesgenerator/names-generator.go b/pkg/namesgenerator/names-generator.go index 7fdf5015ca..99a8d55cce 100644 --- a/pkg/namesgenerator/names-generator.go +++ b/pkg/namesgenerator/names-generator.go @@ -400,7 +400,7 @@ var ( // Jane Goodall - British primatologist, ethologist, and anthropologist who is considered to be the world's foremost expert on chimpanzees - https://en.wikipedia.org/wiki/Jane_Goodall "goodall", - // Stephen Jay Gould was was an American paleontologist, evolutionary biologist, and historian of science. He is most famous for the theory of punctuated equilibrium - https://en.wikipedia.org/wiki/Stephen_Jay_Gould + // Stephen Jay Gould was an American paleontologist, evolutionary biologist, and historian of science. He is most famous for the theory of punctuated equilibrium - https://en.wikipedia.org/wiki/Stephen_Jay_Gould "gould", // Carolyn Widney Greider - American molecular biologist and joint winner of the 2009 Nobel Prize for Physiology or Medicine for the discovery of telomerase. https://en.wikipedia.org/wiki/Carol_W._Greider diff --git a/profiles/seccomp/seccomp.go b/profiles/seccomp/seccomp.go index 45b1e4f76e..1b867ff16c 100644 --- a/profiles/seccomp/seccomp.go +++ b/profiles/seccomp/seccomp.go @@ -24,7 +24,7 @@ type Seccomp struct { // Syscalls contains lists of syscall rules. Rules can define conditions // for them to be included or excluded in the resulting profile (based on - // on kernel version, architecture, capabilities, etc.). These lists are + // kernel version, architecture, capabilities, etc.). These lists are // expanded to an specs.Syscall When generating the profile, these lists // are expanded to a []specs.LinuxSyscall. Syscalls []*Syscall `json:"syscalls"` diff --git a/quota/testhelpers.go b/quota/testhelpers.go index 7734a5d2c2..793f0cb02e 100644 --- a/quota/testhelpers.go +++ b/quota/testhelpers.go @@ -24,7 +24,7 @@ func CanTestQuota() (string, bool) { } // PrepareQuotaTestImage - prepares an xfs prjquota test image -// returns the path the the image on success +// returns the path of the image on success func PrepareQuotaTestImage(t *testing.T) (string, error) { // imageSize is the size of the test-image. The minimum size allowed // is 300MB. diff --git a/restartmanager/restartmanager.go b/restartmanager/restartmanager.go index e1337662c1..16a85077f8 100644 --- a/restartmanager/restartmanager.go +++ b/restartmanager/restartmanager.go @@ -63,7 +63,7 @@ func (rm *RestartManager) ShouldRestart(exitCode uint32, hasBeenManuallyStopped if rm.active { return false, nil, fmt.Errorf("invalid call on an active restart manager") } - // if the container ran for more than 10s, regardless of status and policy reset the + // if the container ran for more than 10s, regardless of status and policy reset // the timeout back to the default. if executionDuration.Seconds() >= 10 { rm.timeout = 0