From 87e8a936e82ecfbef59b829d8bbfca3fb4aa3163 Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Tue, 17 Oct 2017 11:30:05 +0800 Subject: [PATCH] Typo fixed and simple code. Signed-off-by: Ri Xu --- builder/dockerfile/instructions/commands.go | 2 +- builder/dockerfile/instructions/parse.go | 2 +- daemon/network/settings.go | 2 +- integration-cli/check_test.go | 2 +- integration-cli/docker_api_ipcmode_test.go | 6 +----- volume/linux_parser.go | 2 +- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/builder/dockerfile/instructions/commands.go b/builder/dockerfile/instructions/commands.go index 8d5d6b09ae..0863e6b50a 100644 --- a/builder/dockerfile/instructions/commands.go +++ b/builder/dockerfile/instructions/commands.go @@ -9,7 +9,7 @@ import ( "github.com/docker/docker/api/types/strslice" ) -// KeyValuePair represent an arbitrary named value (usefull in slice insted of map[string] string to preserve ordering) +// KeyValuePair represent an arbitrary named value (useful in slice insted of map[string] string to preserve ordering) type KeyValuePair struct { Key string Value string diff --git a/builder/dockerfile/instructions/parse.go b/builder/dockerfile/instructions/parse.go index 86ddc57b7e..0f7c69d263 100644 --- a/builder/dockerfile/instructions/parse.go +++ b/builder/dockerfile/instructions/parse.go @@ -105,7 +105,7 @@ func ParseCommand(node *parser.Node) (Command, error) { return nil, errors.Errorf("%T is not a command type", s) } -// UnknownInstruction represents an error occuring when a command is unresolvable +// UnknownInstruction represents an error occurring when a command is unresolvable type UnknownInstruction struct { Line int Instruction string diff --git a/daemon/network/settings.go b/daemon/network/settings.go index d952b2bdc6..71343ff2bf 100644 --- a/daemon/network/settings.go +++ b/daemon/network/settings.go @@ -42,7 +42,7 @@ type AttachmentStore struct { networkToNodeLBIP map[string]net.IP } -// ResetAttachments clears any exsiting load balancer IP to network mapping and +// ResetAttachments clears any existing load balancer IP to network mapping and // sets the mapping to the given attachments. func (store *AttachmentStore) ResetAttachments(attachments map[string]string) error { store.ClearAttachments() diff --git a/integration-cli/check_test.go b/integration-cli/check_test.go index 2e57e00b34..a0786598b8 100644 --- a/integration-cli/check_test.go +++ b/integration-cli/check_test.go @@ -333,7 +333,7 @@ func (s *DockerSwarmSuite) AddDaemon(c *check.C, joinSwarm, manager bool) *daemo args := []string{"--iptables=false", "--swarm-default-advertise-addr=lo"} // avoid networking conflicts d.StartWithBusybox(c, args...) - if joinSwarm == true { + if joinSwarm { if len(s.daemons) > 0 { tokens := s.daemons[0].JoinTokens(c) token := tokens.Worker diff --git a/integration-cli/docker_api_ipcmode_test.go b/integration-cli/docker_api_ipcmode_test.go index 07fbbca7c0..02548875a3 100644 --- a/integration-cli/docker_api_ipcmode_test.go +++ b/integration-cli/docker_api_ipcmode_test.go @@ -44,11 +44,7 @@ func testIpcCheckDevExists(mm string) (bool, error) { } } - if err := s.Err(); err != nil { - return false, err - } - - return false, nil + return false, s.Err() } // testIpcNonePrivateShareable is a helper function to test "none", diff --git a/volume/linux_parser.go b/volume/linux_parser.go index 1b3493ac75..59605fe677 100644 --- a/volume/linux_parser.go +++ b/volume/linux_parser.go @@ -42,7 +42,7 @@ func linuxValidateAbsolute(p string) error { } func (p *linuxParser) validateMountConfig(mnt *mount.Mount) error { // there was something looking like a bug in existing codebase: - // - validateMountConfig on linux was called with options skipping bind source existance when calling ParseMountRaw + // - validateMountConfig on linux was called with options skipping bind source existence when calling ParseMountRaw // - but not when calling ParseMountSpec directly... nor when the unit test called it directly return p.validateMountConfigImpl(mnt, true) }