From 13d2b086386196e9f4f03e4a18d508a65f6fc5ff Mon Sep 17 00:00:00 2001 From: Caleb Spare Date: Sat, 30 Mar 2013 00:22:24 -0700 Subject: [PATCH] A few spelling/grammar corrections. --- auth/auth.go | 1 + commands.go | 2 +- graph.go | 20 ++++++++++---------- registry.go | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/auth/auth.go b/auth/auth.go index 886d210f61..2c282af218 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -131,6 +131,7 @@ func Login(authConfig *AuthConfig) (string, error) { status = "Account Created\n" storeConfig = true } else if reqStatusCode == 400 { + // FIXME: This should be 'exists', not 'exist'. Need to change on the server first. if string(reqBody) == "Username or email already exist" { client := &http.Client{} req, err := http.NewRequest("GET", REGISTRY_SERVER+"/v1/users", nil) diff --git a/commands.go b/commands.go index ad9688d9c8..a98a27cbb9 100644 --- a/commands.go +++ b/commands.go @@ -65,7 +65,7 @@ func (srv *Server) CmdLogin(stdin io.ReadCloser, stdout io.Writer, args ...strin // Read a line on raw terminal with support for simple backspace // sequences and echo. // - // This function is necessary because the login command must be done a + // This function is necessary because the login command must be done in a // raw terminal for two reasons: // - we have to read a password (without echoing it); // - the rcli "protocol" only supports cannonical and raw modes and you diff --git a/graph.go b/graph.go index ca126dc0e5..0f65aa205f 100644 --- a/graph.go +++ b/graph.go @@ -10,13 +10,13 @@ import ( "time" ) -// A Graph is a store for versioned filesystem images, and the relationship between them. +// A Graph is a store for versioned filesystem images and the relationship between them. type Graph struct { Root string idIndex *TruncIndex } -// NewGraph instanciates a new graph at the given root path in the filesystem. +// NewGraph instantiates a new graph at the given root path in the filesystem. // `root` will be created if it doesn't exist. func NewGraph(root string) (*Graph, error) { abspath, err := filepath.Abs(root) @@ -140,14 +140,14 @@ func (graph *Graph) Mktemp(id string) (string, error) { } // Garbage returns the "garbage", a staging area for deleted images. -// This allows images ot be deleted atomically by os.Rename(), instead of -// os.RemoveAll() which is prone to race conditions +// This allows images to be deleted atomically by os.Rename(), instead of +// os.RemoveAll() which is prone to race conditions. func (graph *Graph) Garbage() (*Graph, error) { return NewGraph(path.Join(graph.Root, ":garbage:")) } -// Check if given error is "not empty" -// Note: this is the way golang do it internally with os.IsNotExists +// Check if given error is "not empty". +// Note: this is the way golang does it internally with os.IsNotExists. func isNotEmpty(err error) bool { switch pe := err.(type) { case nil: @@ -190,7 +190,7 @@ func (graph *Graph) Delete(id string) error { return nil } -// Undelete moves an image back from the garbage to the main graph +// Undelete moves an image back from the garbage to the main graph. func (graph *Graph) Undelete(id string) error { garbage, err := graph.Garbage() if err != nil { @@ -203,7 +203,7 @@ func (graph *Graph) Undelete(id string) error { return nil } -// GarbageCollect definitely deletes all images moved to the garbage +// GarbageCollect definitely deletes all images moved to the garbage. func (graph *Graph) GarbageCollect() error { garbage, err := graph.Garbage() if err != nil { @@ -212,7 +212,7 @@ func (graph *Graph) GarbageCollect() error { return os.RemoveAll(garbage.Root) } -// Map returns a list of all images in the graph, addressable by ID +// Map returns a list of all images in the graph, addressable by ID. func (graph *Graph) Map() (map[string]*Image, error) { // FIXME: this should replace All() all, err := graph.All() @@ -226,7 +226,7 @@ func (graph *Graph) Map() (map[string]*Image, error) { return images, nil } -// All returns a list of all images in the graph +// All returns a list of all images in the graph. func (graph *Graph) All() ([]*Image, error) { var images []*Image err := graph.WalkAll(func(image *Image) { diff --git a/registry.go b/registry.go index 4c51265981..63cfd40350 100644 --- a/registry.go +++ b/registry.go @@ -21,7 +21,7 @@ func NewImgJson(src []byte) (*Image, error) { ret := &Image{} Debugf("Json string: {%s}\n", src) - // FIXME: Is there a cleaner way to "puryfy" the input json? + // FIXME: Is there a cleaner way to "purify" the input json? if err := json.Unmarshal(src, ret); err != nil { return nil, err }