diff --git a/archive/archive.go b/archive/archive.go index 0da6582..1281683 100644 --- a/archive/archive.go +++ b/archive/archive.go @@ -31,7 +31,7 @@ type ( Archive io.ReadCloser // Reader is a type of io.Reader. Reader io.Reader - // Compression is the state represtents if compressed or not. + // Compression is the state represents if compressed or not. Compression int // TarChownOptions wraps the chown options UID and GID. TarChownOptions struct { diff --git a/archive/archive_unix.go b/archive/archive_unix.go index abf9ad7..fbc3bb8 100644 --- a/archive/archive_unix.go +++ b/archive/archive_unix.go @@ -19,7 +19,7 @@ func fixVolumePathPrefix(srcPath string) string { } // getWalkRoot calculates the root path when performing a TarWithOptions. -// We use a seperate function as this is platform specific. On Linux, we +// We use a separate function as this is platform specific. On Linux, we // can't use filepath.Join(srcPath,include) because this will clean away // a trailing "." or "/" which may be important. func getWalkRoot(srcPath string, include string) string { diff --git a/archive/archive_windows.go b/archive/archive_windows.go index b348cde..5c3a1be 100644 --- a/archive/archive_windows.go +++ b/archive/archive_windows.go @@ -19,7 +19,7 @@ func fixVolumePathPrefix(srcPath string) string { } // getWalkRoot calculates the root path when performing a TarWithOptions. -// We use a seperate function as this is platform specific. +// We use a separate function as this is platform specific. func getWalkRoot(srcPath string, include string) string { return filepath.Join(srcPath, include) } diff --git a/archive/changes.go b/archive/changes.go index e0bd4c4..81651c6 100644 --- a/archive/changes.go +++ b/archive/changes.go @@ -150,7 +150,7 @@ func Changes(layers []string, rw string) ([]Change, error) { // If /foo/bar/file.txt is modified, then /foo/bar must be part of the changed files. // This block is here to ensure the change is recorded even if the - // modify time, mode and size of the parent directoriy in the rw and ro layers are all equal. + // modify time, mode and size of the parent directory in the rw and ro layers are all equal. // Check https://github.com/docker/docker/pull/13590 for details. if f.IsDir() { changedDirs[path] = struct{}{} diff --git a/archive/whiteouts.go b/archive/whiteouts.go index 3d9c313..d20478a 100644 --- a/archive/whiteouts.go +++ b/archive/whiteouts.go @@ -9,7 +9,7 @@ package archive const WhiteoutPrefix = ".wh." // WhiteoutMetaPrefix prefix means whiteout has a special meaning and is not -// for remoing an actaul file. Normally these files are excluded from exported +// for removing an actual file. Normally these files are excluded from exported // archives. const WhiteoutMetaPrefix = WhiteoutPrefix + WhiteoutPrefix diff --git a/devicemapper/attach_loopback.go b/devicemapper/attach_loopback.go index 6670bd4..30e0a48 100644 --- a/devicemapper/attach_loopback.go +++ b/devicemapper/attach_loopback.go @@ -87,7 +87,7 @@ func openNextAvailableLoopback(index int, sparseFile *os.File) (loopFile *os.Fil func AttachLoopDevice(sparseName string) (loop *os.File, err error) { // Try to retrieve the next available loopback device via syscall. - // If it fails, we discard error and start loopking for a + // If it fails, we discard error and start looping for a // loopback from index 0. startIndex, err := getNextFreeLoopbackIndex() if err != nil { diff --git a/discovery/kv/kv_test.go b/discovery/kv/kv_test.go index 2475e33..a513309 100644 --- a/discovery/kv/kv_test.go +++ b/discovery/kv/kv_test.go @@ -290,7 +290,7 @@ func (s *FakeStore) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVP } // WatchTree will fail the first time, and return the mockKVchan afterwards. -// This is the behaviour we need for testing.. If we need 'moar', should update this. +// This is the behavior we need for testing.. If we need 'moar', should update this. func (s *FakeStore) WatchTree(directory string, stopCh <-chan struct{}) (<-chan []*store.KVPair, error) { if s.watchTreeCallCount == 0 { s.watchTreeCallCount = 1 diff --git a/filenotify/filenotify.go b/filenotify/filenotify.go index e042c6b..23befae 100644 --- a/filenotify/filenotify.go +++ b/filenotify/filenotify.go @@ -1,6 +1,6 @@ // Package filenotify provides a mechanism for watching file(s) for changes. // Generally leans on fsnotify, but provides a poll-based notifier which fsnotify does not support. -// These are wrapped up in a common interface so that either can be used interchangably in your code. +// These are wrapped up in a common interface so that either can be used interchangeably in your code. package filenotify import "gopkg.in/fsnotify.v1" diff --git a/filenotify/poller.go b/filenotify/poller.go index a55266d..0d92afd 100644 --- a/filenotify/poller.go +++ b/filenotify/poller.go @@ -24,7 +24,7 @@ const watchWaitTime = 200 * time.Millisecond // filePoller is used to poll files for changes, especially in cases where fsnotify // can't be run (e.g. when inotify handles are exhausted) -// filePoller satifies the FileWatcher interface +// filePoller satisfies the FileWatcher interface type filePoller struct { // watches is the list of files currently being polled, close the associated channel to stop the watch watches map[string]chan struct{} diff --git a/fileutils/fileutils.go b/fileutils/fileutils.go index 3fdf692..b5057ec 100644 --- a/fileutils/fileutils.go +++ b/fileutils/fileutils.go @@ -78,7 +78,7 @@ func Matches(file string, patterns []string) (bool, error) { // OptimizedMatches is basically the same as fileutils.Matches() but optimized for archive.go. // It will assume that the inputs have been preprocessed and therefore the function -// doen't need to do as much error checking and clean-up. This was done to avoid +// doesn't need to do as much error checking and clean-up. This was done to avoid // repeating these steps on each file being checked during the archive process. // The more generic fileutils.Matches() can't make these assumptions. func OptimizedMatches(file string, patterns []string, patDirs [][]string) (bool, error) { diff --git a/integration/utils.go b/integration/utils.go index 330a533..48c33b6 100644 --- a/integration/utils.go +++ b/integration/utils.go @@ -295,7 +295,7 @@ func ConsumeWithSpeed(reader io.Reader, chunkSize int, interval time.Duration, s } } -// ParseCgroupPaths arses 'procCgroupData', which is output of '/proc//cgroup', and returns +// ParseCgroupPaths parses 'procCgroupData', which is output of '/proc//cgroup', and returns // a map which cgroup name as key and path as value. func ParseCgroupPaths(procCgroupData string) map[string]string { cgroupPaths := map[string]string{} @@ -337,7 +337,7 @@ func (c *ChannelBuffer) ReadTimeout(p []byte, n time.Duration) (int, error) { } } -// RunAtDifferentDate runs the specifed function with the given time. +// RunAtDifferentDate runs the specified function with the given time. // It changes the date of the system, which can led to weird behaviors. func RunAtDifferentDate(date time.Time, block func()) { // Layout for date. MMDDhhmmYYYY diff --git a/integration/utils_test.go b/integration/utils_test.go index 7c5df4e..b2c5849 100644 --- a/integration/utils_test.go +++ b/integration/utils_test.go @@ -309,7 +309,7 @@ func TestCompareDirectoryEntries(t *testing.T) { } } -// FIXME make an "unhappy path" test for ListTar without "panicing" :-) +// FIXME make an "unhappy path" test for ListTar without "panicking" :-) func TestListTar(t *testing.T) { tmpFolder, err := ioutil.TempDir("", "integration-cli-utils-list-tar") if err != nil { diff --git a/ioutils/writers.go b/ioutils/writers.go index 7a3249f..ccc7f9c 100644 --- a/ioutils/writers.go +++ b/ioutils/writers.go @@ -20,7 +20,7 @@ func NopWriteCloser(w io.Writer) io.WriteCloser { return &nopWriteCloser{w} } -// NopFlusher represents a type which flush opetatin is nop. +// NopFlusher represents a type which flush operation is nop. type NopFlusher struct{} // Flush is a nop operation. diff --git a/jsonlog/jsonlog.go b/jsonlog/jsonlog.go index 9a71769..422e4bb 100644 --- a/jsonlog/jsonlog.go +++ b/jsonlog/jsonlog.go @@ -19,8 +19,8 @@ type JSONLog struct { // Format returns the log formatted according to format // If format is nil, returns the log message -// If format is json, returns the log marshalled in json format -// By defalut, returns the log with the log time formatted according to format. +// If format is json, returns the log marshaled in json format +// By default, returns the log with the log time formatted according to format. func (jl *JSONLog) Format(format string) (string, error) { if format == "" { return jl.Log, nil diff --git a/jsonmessage/jsonmessage.go b/jsonmessage/jsonmessage.go index e20b242..c234ff6 100644 --- a/jsonmessage/jsonmessage.go +++ b/jsonmessage/jsonmessage.go @@ -60,7 +60,7 @@ func (p *JSONProgress) String() string { percentage = 50 } if width > 110 { - // this number can't be negetive gh#7136 + // this number can't be negative gh#7136 numSpaces := 0 if 50-percentage > 0 { numSpaces = 50 - percentage @@ -106,7 +106,7 @@ type JSONMessage struct { // Display displays the JSONMessage to `out`. `isTerminal` describes if `out` // is a terminal. If this is the case, it will erase the entire current line -// when dislaying the progressbar. +// when displaying the progressbar. func (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error { if jm.Error != nil { if jm.Error.Code == 401 { diff --git a/locker/locker.go b/locker/locker.go index e4984ba..0b22ddf 100644 --- a/locker/locker.go +++ b/locker/locker.go @@ -41,7 +41,7 @@ func (l *lockCtr) inc() { atomic.AddInt32(&l.waiters, 1) } -// dec decrements the number of waiters wating on the lock +// dec decrements the number of waiters waiting on the lock func (l *lockCtr) dec() { atomic.AddInt32(&l.waiters, -1) } diff --git a/mflag/flag.go b/mflag/flag.go index d430f13..ddcd62c 100644 --- a/mflag/flag.go +++ b/mflag/flag.go @@ -1228,7 +1228,7 @@ func (v mergeVal) IsBoolFlag() bool { // Merge is an helper function that merges n FlagSets into a single dest FlagSet // In case of name collision between the flagsets it will apply -// the destination FlagSet's errorHandling behaviour. +// the destination FlagSet's errorHandling behavior. func Merge(dest *FlagSet, flagsets ...*FlagSet) error { for _, fset := range flagsets { for k, f := range fset.formal { diff --git a/mount/flags_linux.go b/mount/flags_linux.go index 2f9f5c5..dc696dc 100644 --- a/mount/flags_linux.go +++ b/mount/flags_linux.go @@ -23,7 +23,7 @@ const ( SYNCHRONOUS = syscall.MS_SYNCHRONOUS // DIRSYNC will force all directory updates within the file system to be done - // synchronously. This affects the following system calls: creat, link, + // synchronously. This affects the following system calls: create, link, // unlink, symlink, mkdir, rmdir, mknod and rename. DIRSYNC = syscall.MS_DIRSYNC diff --git a/mount/sharedsubtree_linux_test.go b/mount/sharedsubtree_linux_test.go index 4a8d22f..c183794 100644 --- a/mount/sharedsubtree_linux_test.go +++ b/mount/sharedsubtree_linux_test.go @@ -168,7 +168,7 @@ func TestSubtreeShared(t *testing.T) { } }() - // NOW, check that the file from the outside directory is avaible in the source directory + // NOW, check that the file from the outside directory is available in the source directory if _, err := os.Stat(sourceCheckPath); err != nil { t.Fatal(err) } diff --git a/parsers/filters/parse.go b/parsers/filters/parse.go index 7444201..6c423ce 100644 --- a/parsers/filters/parse.go +++ b/parsers/filters/parse.go @@ -128,7 +128,7 @@ func (filters Args) Len() int { return len(filters.fields) } -// MatchKVList returns true if the values for the specified field maches the ones +// MatchKVList returns true if the values for the specified field matches the ones // from the sources. // e.g. given Args are {'label': {'label1=1','label2=1'}, 'image.name', {'ubuntu'}}, // field is 'label' and sources are {'label1': '1', 'label2': '2'} diff --git a/random/random.go b/random/random.go index e560aff..70de4d1 100644 --- a/random/random.go +++ b/random/random.go @@ -10,7 +10,7 @@ import ( "time" ) -// Rand is a global *rand.Rand instance, which initilized with NewSource() source. +// Rand is a global *rand.Rand instance, which initialized with NewSource() source. var Rand = rand.New(NewSource()) // Reader is a global, shared instance of a pseudorandom bytes generator. diff --git a/reexec/reexec.go b/reexec/reexec.go index 20491e0..ceb98d2 100644 --- a/reexec/reexec.go +++ b/reexec/reexec.go @@ -41,7 +41,7 @@ func naiveSelf() string { if absName, err := filepath.Abs(name); err == nil { return absName } - // if we coudn't get absolute name, return original + // if we couldn't get absolute name, return original // (NOTE: Go only errors on Abs() if os.Getwd fails) return name } diff --git a/streamformatter/streamformatter.go b/streamformatter/streamformatter.go index b67a53d..d670018 100644 --- a/streamformatter/streamformatter.go +++ b/streamformatter/streamformatter.go @@ -54,7 +54,7 @@ func (sf *StreamFormatter) FormatStatus(id, format string, a ...interface{}) []b return []byte(str + streamNewline) } -// FormatError formats the specifed error. +// FormatError formats the specified error. func (sf *StreamFormatter) FormatError(err error) []byte { if sf.json { jsonError, ok := err.(*jsonmessage.JSONError) diff --git a/stringid/stringid.go b/stringid/stringid.go index 0332da6..02d2594 100644 --- a/stringid/stringid.go +++ b/stringid/stringid.go @@ -48,7 +48,7 @@ func generateID(crypto bool) string { } id := hex.EncodeToString(b) // if we try to parse the truncated for as an int and we don't have - // an error then the value is all numberic and causes issues when + // an error then the value is all numeric and causes issues when // used as a hostname. ref #3869 if _, err := strconv.ParseInt(TruncateID(id), 10, 64); err == nil { continue diff --git a/stringutils/strslice.go b/stringutils/strslice.go index 4055754..dfe535e 100644 --- a/stringutils/strslice.go +++ b/stringutils/strslice.go @@ -5,7 +5,7 @@ import ( "strings" ) -// StrSlice representes a string or an array of strings. +// StrSlice represents a string or an array of strings. // We need to override the json decoder to accept both options. type StrSlice struct { parts []string diff --git a/symlink/fs_windows.go b/symlink/fs_windows.go index 29bd456..70988a3 100644 --- a/symlink/fs_windows.go +++ b/symlink/fs_windows.go @@ -91,7 +91,7 @@ func walkSymlinks(path string) (string, error) { return "", errors.New("EvalSymlinks: too many links in " + originalPath) } - // A path beginnging with `\\?\` represents the root, so automatically + // A path beginning with `\\?\` represents the root, so automatically // skip that part and begin processing the next segment. if strings.HasPrefix(path, longpath.Prefix) { b.WriteString(longpath.Prefix) diff --git a/sysinfo/sysinfo.go b/sysinfo/sysinfo.go index c12619f..3c7e9ed 100644 --- a/sysinfo/sysinfo.go +++ b/sysinfo/sysinfo.go @@ -36,7 +36,7 @@ type cgroupMemInfo struct { // Whether soft limit is supported or not MemoryReservation bool - // Whether OOM killer disalbe is supported or not + // Whether OOM killer disable is supported or not OomKillDisable bool // Whether memory swappiness is supported or not diff --git a/system/utimes_linux.go b/system/utimes_linux.go index 007bfa8..fc8a1ab 100644 --- a/system/utimes_linux.go +++ b/system/utimes_linux.go @@ -5,7 +5,7 @@ import ( "unsafe" ) -// LUtimesNano is used to change access and modification time of the speficied path. +// LUtimesNano is used to change access and modification time of the specified path. // It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm. func LUtimesNano(path string, ts []syscall.Timespec) error { // These are not currently available in syscall diff --git a/tarsum/fileinfosums.go b/tarsum/fileinfosums.go index 7c2161c..5abf5e7 100644 --- a/tarsum/fileinfosums.go +++ b/tarsum/fileinfosums.go @@ -4,7 +4,7 @@ import "sort" // FileInfoSumInterface provides an interface for accessing file checksum // information within a tar file. This info is accessed through interface -// so the actual name and sum cannot be medled with. +// so the actual name and sum cannot be melded with. type FileInfoSumInterface interface { // File name Name() string diff --git a/tarsum/tarsum.go b/tarsum/tarsum.go index 0f5783b..4dc89bd 100644 --- a/tarsum/tarsum.go +++ b/tarsum/tarsum.go @@ -146,7 +146,7 @@ var ( } ) -// DefaultTHash is default TarSum hashing algoritm - "sha256". +// DefaultTHash is default TarSum hashing algorithm - "sha256". var DefaultTHash = NewTHash("sha256", sha256.New) type simpleTHash struct { @@ -261,7 +261,7 @@ func (ts *tarSum) Read(buf []byte) (int, error) { return 0, err } - // Filling the tar writter + // Filling the tar writer if _, err = ts.tarW.Write(buf2[:n]); err != nil { return 0, err } diff --git a/term/term.go b/term/term.go index 7912ae4..316c399 100644 --- a/term/term.go +++ b/term/term.go @@ -51,7 +51,7 @@ func GetFdInfo(in interface{}) (uintptr, bool) { func GetWinsize(fd uintptr) (*Winsize, error) { ws := &Winsize{} _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(ws))) - // Skipp errno = 0 + // Skip errno = 0 if err == 0 { return ws, nil } @@ -61,7 +61,7 @@ func GetWinsize(fd uintptr) (*Winsize, error) { // SetWinsize tries to set the specified window size for the specified file descriptor. func SetWinsize(fd uintptr, ws *Winsize) error { _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws))) - // Skipp errno = 0 + // Skip errno = 0 if err == 0 { return nil } diff --git a/timeutils/utils.go b/timeutils/utils.go index 7502e88..077d091 100644 --- a/timeutils/utils.go +++ b/timeutils/utils.go @@ -44,7 +44,7 @@ func GetTimestamp(value string, reference time.Time) (string, error) { // we want the number of colons in the T portion of the timestamp tcolons := strings.Count(value, ":") // if parseInLocation is off and we have a +/- zone offset (not Z) then - // there will be an extra colon in the input for the tz offset subract that + // there will be an extra colon in the input for the tz offset subtract that // colon from the tcolons count if !parseInLocation && !strings.ContainsAny(value, "zZ") && tcolons > 0 { tcolons-- diff --git a/useragent/useragent.go b/useragent/useragent.go index a410974..1137db5 100644 --- a/useragent/useragent.go +++ b/useragent/useragent.go @@ -29,8 +29,8 @@ func (vi *VersionInfo) isValid() bool { // // Each VersionInfo will be converted to a string in the format of // "product/version", where the "product" is get from the name field, while -// version is get from the version field. Several pieces of verson information -// will be concatinated and separated by space. +// version is get from the version field. Several pieces of version information +// will be concatenated and separated by space. // // Example: // AppendVersions("base", VersionInfo{"foo", "1.0"}, VersionInfo{"bar", "2.0"})