From 0fccf0f68655fd01973e4c00bbb063fad1bce56c Mon Sep 17 00:00:00 2001 From: Ben Wiklund Date: Tue, 24 Dec 2013 16:37:00 -0800 Subject: [PATCH] small batch of edits/corrections to comments --- AUTHORS | 1 + archive/changes_test.go | 2 +- archive/diff.go | 14 +++++++------- archive/stat_linux.go | 2 +- auth/auth.go | 10 +++++----- engine/engine_test.go | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/AUTHORS b/AUTHORS index 2476208d13..f9ee14854b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -20,6 +20,7 @@ Antony Messerli Asbjørn Enge Barry Allard Ben Toews +Ben Wiklund Benoit Chesneau Bhiraj Butala Bouke Haarsma diff --git a/archive/changes_test.go b/archive/changes_test.go index e11ed90ac1..1302b76f47 100644 --- a/archive/changes_test.go +++ b/archive/changes_test.go @@ -296,6 +296,6 @@ func TestApplyLayer(t *testing.T) { } if len(changes2) != 0 { - t.Fatalf("Unexpected differences after re applying mutation: %v", changes2) + t.Fatalf("Unexpected differences after reapplying mutation: %v", changes2) } } diff --git a/archive/diff.go b/archive/diff.go index 72a53de02e..464d57a742 100644 --- a/archive/diff.go +++ b/archive/diff.go @@ -11,9 +11,9 @@ import ( "time" ) -// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes -// The lower 8 bit is the lower 8 bit in the minor, the following 12 bits are the major, -// and then there is the top 12 bits of then minor +// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. +// They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, +// then the top 12 bits of the minor func mkdev(major int64, minor int64) uint32 { return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff)) } @@ -58,9 +58,9 @@ func ApplyLayer(dest string, layer Archive) error { hdr.Name = filepath.Clean(hdr.Name) if !strings.HasSuffix(hdr.Name, "/") { - // Not the root directory, ensure that the parent directory exists + // Not the root directory, ensure that the parent directory exists. // This happened in some tests where an image had a tarfile without any - // parent directories + // parent directories. parent := filepath.Dir(hdr.Name) parentPath := filepath.Join(dest, parent) if _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) { @@ -85,7 +85,7 @@ func ApplyLayer(dest string, layer Archive) error { return err } } else { - // If path exits we almost always just want to remove and replace it + // If path exits we almost always just want to remove and replace it. // The only exception is when it is a directory *and* the file from // the layer is also a directory. Then we want to merge them (i.e. // just apply the metadata from the layer). @@ -155,7 +155,7 @@ func ApplyLayer(dest string, layer Archive) error { return err } - // There is no LChmod, so ignore mode for symlink. Also, this + // There is no LChmod, so ignore mode for symlink. Also, this // must happen after chown, as that can modify the file mode if hdr.Typeflag != tar.TypeSymlink { err = syscall.Chmod(path, uint32(hdr.Mode&07777)) diff --git a/archive/stat_linux.go b/archive/stat_linux.go index 2203a46aff..2f7a520ccd 100644 --- a/archive/stat_linux.go +++ b/archive/stat_linux.go @@ -14,7 +14,7 @@ func getLastModification(stat *syscall.Stat_t) syscall.Timespec { } func LUtimesNano(path string, ts []syscall.Timespec) error { - // These are not currently availible in syscall + // These are not currently available in syscall AT_FDCWD := -100 AT_SYMLINK_NOFOLLOW := 0x100 diff --git a/auth/auth.go b/auth/auth.go index e88fb908f9..770a6a0c0f 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -163,7 +163,7 @@ func Login(authConfig *AuthConfig, factory *utils.HTTPRequestFactory) (string, e loginAgainstOfficialIndex := serverAddress == IndexServerAddress() - // to avoid sending the server address to the server it should be removed before marshalled + // to avoid sending the server address to the server it should be removed before being marshalled authCopy := *authConfig authCopy.ServerAddress = "" @@ -254,11 +254,11 @@ func (config *ConfigFile) ResolveAuthConfig(registry string) AuthConfig { // default to the index server return config.Configs[IndexServerAddress()] } - // if its not the index server there are three cases: + // if it's not the index server there are three cases: // - // 1. this is a full config url -> it should be used as is - // 2. it could be a full url, but with the wrong protocol - // 3. it can be the hostname optionally with a port + // 1. a full config url -> it should be used as is + // 2. a full url, but with the wrong protocol + // 3. a hostname, with an optional port // // as there is only one auth entry which is fully qualified we need to start // parsing and matching diff --git a/engine/engine_test.go b/engine/engine_test.go index 793867f50a..065a19f492 100644 --- a/engine/engine_test.go +++ b/engine/engine_test.go @@ -18,7 +18,7 @@ func TestRegister(t *testing.T) { eng := newTestEngine(t) - //Should fail because globan handlers are copied + //Should fail because global handlers are copied //at the engine creation if err := eng.Register("dummy1", nil); err == nil { t.Fatalf("Expecting error, got none")