diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 065dee9e0d..b0df9229a2 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -701,7 +701,7 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes. if hostConfig.CgroupParent != "" && UsingSystemd(daemon.configStore) { // CgroupParent for systemd cgroup should be named as "xxx.slice" if len(hostConfig.CgroupParent) <= 6 || !strings.HasSuffix(hostConfig.CgroupParent, ".slice") { - return warnings, fmt.Errorf("cgroup-parent for systemd cgroup should be a valid slice named as \"xxx.slice\"") + return warnings, fmt.Errorf(`cgroup-parent for systemd cgroup should be a valid slice named as "xxx.slice"`) } } if hostConfig.Runtime == "" { @@ -754,7 +754,7 @@ func verifyDaemonSettings(conf *config.Config) error { } if conf.CgroupParent != "" && UsingSystemd(conf) { if len(conf.CgroupParent) <= 6 || !strings.HasSuffix(conf.CgroupParent, ".slice") { - return fmt.Errorf("cgroup-parent for systemd cgroup should be a valid slice named as \"xxx.slice\"") + return fmt.Errorf(`cgroup-parent for systemd cgroup should be a valid slice named as "xxx.slice"`) } } @@ -1069,7 +1069,7 @@ func initBridgeDriver(controller *libnetwork.Controller, config *config.Config) libnetwork.NetworkOptionIpam("default", "", v4Conf, v6Conf, nil), libnetwork.NetworkOptionDeferIPv6Alloc(deferIPv6Alloc)) if err != nil { - return fmt.Errorf("Error creating default \"bridge\" network: %v", err) + return fmt.Errorf(`error creating default "bridge" network: %v`, err) } return nil } diff --git a/daemon/daemon_unix_test.go b/daemon/daemon_unix_test.go index f44c0be48f..03d04a579c 100644 --- a/daemon/daemon_unix_test.go +++ b/daemon/daemon_unix_test.go @@ -148,7 +148,7 @@ func TestParseSecurityOptWithDeprecatedColon(t *testing.T) { t.Fatalf("Unexpected parseSecurityOpt error: %v", err) } if opts.AppArmorProfile != "test_profile" { - t.Fatalf("Unexpected AppArmorProfile, expected: \"test_profile\", got %q", opts.AppArmorProfile) + t.Fatalf(`Unexpected AppArmorProfile, expected: "test_profile", got %q`, opts.AppArmorProfile) } // test seccomp diff --git a/daemon/network.go b/daemon/network.go index 3bf8852d4f..ade5bbc80b 100644 --- a/daemon/network.go +++ b/daemon/network.go @@ -375,7 +375,7 @@ func (daemon *Daemon) createNetwork(create types.NetworkCreateRequest, id string if err != nil { if errors.Is(err, libnetwork.ErrDataStoreNotInitialized) { //nolint: revive - return nil, errors.New("This node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again.") + return nil, errors.New(`This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.`) } return nil, err } diff --git a/daemon/top_unix.go b/daemon/top_unix.go index 68da2596e4..e2cc38c3a4 100644 --- a/daemon/top_unix.go +++ b/daemon/top_unix.go @@ -29,7 +29,7 @@ func validatePSArgs(psArgs string) error { k := group[1] v := group[2] if k != "pid" { - return fmt.Errorf("specifying \"%s=%s\" is not allowed", k, v) + return fmt.Errorf(`specifying "%s=%s" is not allowed`, k, v) } } } diff --git a/daemon/top_unix_test.go b/daemon/top_unix_test.go index a663323b67..4bf4d23408 100644 --- a/daemon/top_unix_test.go +++ b/daemon/top_unix_test.go @@ -12,8 +12,8 @@ import ( func TestContainerTopValidatePSArgs(t *testing.T) { tests := map[string]bool{ "ae -o uid=PID": true, - "ae -o \"uid= PID\"": true, // ascii space (0x20) - "ae -o \"uid= PID\"": false, // unicode space (U+2003, 0xe2 0x80 0x83) + `ae -o "uid= PID"`: true, // ascii space (0x20) + `ae -o "uid= PID"`: false, // unicode space (U+2003, 0xe2 0x80 0x83) "ae o uid=PID": true, "aeo uid=PID": true, "ae -O uid=PID": true, diff --git a/daemon/update.go b/daemon/update.go index f01635e49e..fb88bc6f80 100644 --- a/daemon/update.go +++ b/daemon/update.go @@ -53,7 +53,7 @@ func (daemon *Daemon) update(name string, hostConfig *container.HostConfig) erro if ctr.RemovalInProgress || ctr.Dead { ctr.Unlock() - return errCannotUpdate(ctr.ID, fmt.Errorf("container is marked for removal and cannot be \"update\"")) + return errCannotUpdate(ctr.ID, fmt.Errorf(`container is marked for removal and cannot be "update"`)) } if err := ctr.UpdateContainer(hostConfig); err != nil {