Browse code

fix typos in pkg

Signed-off-by: allencloud <allen.sun@daocloud.io>

allencloud authored on 2016/04/09 22:18:15
Showing 10 changed files
... ...
@@ -5,7 +5,7 @@ import (
5 5
 )
6 6
 
7 7
 // Utsname represents the system name structure.
8
-// It is passthgrouh for syscall.Utsname in order to make it portable with
8
+// It is passthrough for syscall.Utsname in order to make it portable with
9 9
 // other platforms where it is not available.
10 10
 type Utsname syscall.Utsname
11 11
 
... ...
@@ -4,7 +4,7 @@ import (
4 4
 	"os/exec"
5 5
 )
6 6
 
7
-// runtimeArchitecture get the name of the current architecture (x86, x86_64, …)
7
+// runtimeArchitecture gets the name of the current architecture (x86, x86_64, …)
8 8
 func runtimeArchitecture() (string, error) {
9 9
 	cmd := exec.Command("uname", "-m")
10 10
 	machine, err := cmd.Output()
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"syscall"
7 7
 )
8 8
 
9
-// runtimeArchitecture get the name of the current architecture (x86, x86_64, …)
9
+// runtimeArchitecture gets the name of the current architecture (x86, x86_64, …)
10 10
 func runtimeArchitecture() (string, error) {
11 11
 	utsname := &syscall.Utsname{}
12 12
 	if err := syscall.Uname(utsname); err != nil {
... ...
@@ -36,7 +36,7 @@ const (
36 36
 
37 37
 var sysinfo systeminfo
38 38
 
39
-// runtimeArchitecture get the name of the current architecture (x86, x86_64, …)
39
+// runtimeArchitecture gets the name of the current architecture (x86, x86_64, …)
40 40
 func runtimeArchitecture() (string, error) {
41 41
 	syscall.Syscall(procGetSystemInfo.Addr(), 1, uintptr(unsafe.Pointer(&sysinfo)), 0, 0)
42 42
 	switch sysinfo.wProcessorArchitecture {
... ...
@@ -17,7 +17,7 @@ func init() {
17 17
 	var err error
18 18
 	Architecture, err = runtimeArchitecture()
19 19
 	if err != nil {
20
-		logrus.Errorf("Could no read system architecture info: %v", err)
20
+		logrus.Errorf("Could not read system architecture info: %v", err)
21 21
 	}
22 22
 	OSType = runtime.GOOS
23 23
 }
... ...
@@ -12,7 +12,7 @@ var registeredInitializers = make(map[string]func())
12 12
 // Register adds an initialization func under the specified name
13 13
 func Register(name string, initializer func()) {
14 14
 	if _, exists := registeredInitializers[name]; exists {
15
-		panic(fmt.Sprintf("reexec func already registred under name %q", name))
15
+		panic(fmt.Sprintf("reexec func already registered under name %q", name))
16 16
 	}
17 17
 
18 18
 	registeredInitializers[name] = initializer
... ...
@@ -15,7 +15,7 @@ var (
15 15
 	ErrNoSuchKey = errors.New("provided key does not exist")
16 16
 )
17 17
 
18
-// Registrar stores indexes a list of keys and their registered names as well as indexes names and the key that they are registred to
18
+// Registrar stores indexes a list of keys and their registered names as well as indexes names and the key that they are registered to
19 19
 // Names must be unique.
20 20
 // Registrar is safe for concurrent access.
21 21
 type Registrar struct {
... ...
@@ -24,7 +24,7 @@ func IsShortID(id string) bool {
24 24
 // TruncateID returns a shorthand version of a string identifier for convenience.
25 25
 // A collision with other shorthands is very unlikely, but possible.
26 26
 // In case of a collision a lookup with TruncIndex.Get() will fail, and the caller
27
-// will need to use a langer prefix, or the full-length Id.
27
+// will need to use a longer prefix, or the full-length Id.
28 28
 func TruncateID(id string) string {
29 29
 	if i := strings.IndexRune(id, ':'); i >= 0 {
30 30
 		id = id[i+1:]
... ...
@@ -57,7 +57,7 @@ func generateID(crypto bool) string {
57 57
 	}
58 58
 }
59 59
 
60
-// GenerateRandomID returns an unique id.
60
+// GenerateRandomID returns a unique id.
61 61
 func GenerateRandomID() string {
62 62
 	return generateID(true)
63 63
 
... ...
@@ -20,7 +20,7 @@ func GenerateRandomAlphaOnlyString(n int) string {
20 20
 	return string(b)
21 21
 }
22 22
 
23
-// GenerateRandomASCIIString generates an ASCII random stirng with length n.
23
+// GenerateRandomASCIIString generates an ASCII random string with length n.
24 24
 func GenerateRandomASCIIString(n int) string {
25 25
 	chars := "abcdefghijklmnopqrstuvwxyz" +
26 26
 		"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
... ...
@@ -74,7 +74,7 @@ func quote(word string, buf *bytes.Buffer) {
74 74
 }
75 75
 
76 76
 // ShellQuoteArguments takes a list of strings and escapes them so they will be
77
-// handled right when passed as arguments to an program via a shell
77
+// handled right when passed as arguments to a program via a shell
78 78
 func ShellQuoteArguments(args []string) string {
79 79
 	var buf bytes.Buffer
80 80
 	for i, arg := range args {
... ...
@@ -7,7 +7,7 @@ import (
7 7
 )
8 8
 
9 9
 // Umask sets current process's file mode creation mask to newmask
10
-// and return oldmask.
10
+// and returns oldmask.
11 11
 func Umask(newmask int) (oldmask int, err error) {
12 12
 	return syscall.Umask(newmask), nil
13 13
 }