浏览代码

A few spelling/grammar corrections.

Caleb Spare 12 年之前
父节点
当前提交
13d2b08638
共有 4 个文件被更改,包括 13 次插入12 次删除
  1. 1 0
      auth/auth.go
  2. 1 1
      commands.go
  3. 10 10
      graph.go
  4. 1 1
      registry.go

+ 1 - 0
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)

+ 1 - 1
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

+ 10 - 10
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) {

+ 1 - 1
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
 	}