Fix typos found across repository

Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
This commit is contained in:
Justas Brazauskas 2015-12-13 18:00:39 +02:00
parent df5dc52c05
commit 244162287a
33 changed files with 39 additions and 39 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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)
}

View File

@ -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{}{}

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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"

View File

@ -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{}

View File

@ -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) {

View File

@ -295,7 +295,7 @@ func ConsumeWithSpeed(reader io.Reader, chunkSize int, interval time.Duration, s
}
}
// ParseCgroupPaths arses 'procCgroupData', which is output of '/proc/<pid>/cgroup', and returns
// ParseCgroupPaths parses 'procCgroupData', which is output of '/proc/<pid>/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

View File

@ -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 {

View File

@ -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.

View File

@ -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

View File

@ -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 {

View File

@ -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)
}

View File

@ -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 {

View File

@ -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

View File

@ -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)
}

View File

@ -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'}

View File

@ -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.

View File

@ -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
}

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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
}

View File

@ -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--

View File

@ -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"})