mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #21906 from allencloud/fix-typos-pkg
fix typos in pkg
This commit is contained in:
commit
417fce0b77
10 changed files with 12 additions and 12 deletions
|
@ -5,7 +5,7 @@ import (
|
|||
)
|
||||
|
||||
// Utsname represents the system name structure.
|
||||
// It is passthgrouh for syscall.Utsname in order to make it portable with
|
||||
// It is passthrough for syscall.Utsname in order to make it portable with
|
||||
// other platforms where it is not available.
|
||||
type Utsname syscall.Utsname
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"os/exec"
|
||||
)
|
||||
|
||||
// runtimeArchitecture get the name of the current architecture (x86, x86_64, …)
|
||||
// runtimeArchitecture gets the name of the current architecture (x86, x86_64, …)
|
||||
func runtimeArchitecture() (string, error) {
|
||||
cmd := exec.Command("uname", "-m")
|
||||
machine, err := cmd.Output()
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"syscall"
|
||||
)
|
||||
|
||||
// runtimeArchitecture get the name of the current architecture (x86, x86_64, …)
|
||||
// runtimeArchitecture gets the name of the current architecture (x86, x86_64, …)
|
||||
func runtimeArchitecture() (string, error) {
|
||||
utsname := &syscall.Utsname{}
|
||||
if err := syscall.Uname(utsname); err != nil {
|
||||
|
|
|
@ -36,7 +36,7 @@ const (
|
|||
|
||||
var sysinfo systeminfo
|
||||
|
||||
// runtimeArchitecture get the name of the current architecture (x86, x86_64, …)
|
||||
// runtimeArchitecture gets the name of the current architecture (x86, x86_64, …)
|
||||
func runtimeArchitecture() (string, error) {
|
||||
syscall.Syscall(procGetSystemInfo.Addr(), 1, uintptr(unsafe.Pointer(&sysinfo)), 0, 0)
|
||||
switch sysinfo.wProcessorArchitecture {
|
||||
|
|
|
@ -17,7 +17,7 @@ func init() {
|
|||
var err error
|
||||
Architecture, err = runtimeArchitecture()
|
||||
if err != nil {
|
||||
logrus.Errorf("Could no read system architecture info: %v", err)
|
||||
logrus.Errorf("Could not read system architecture info: %v", err)
|
||||
}
|
||||
OSType = runtime.GOOS
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ var registeredInitializers = make(map[string]func())
|
|||
// Register adds an initialization func under the specified name
|
||||
func Register(name string, initializer func()) {
|
||||
if _, exists := registeredInitializers[name]; exists {
|
||||
panic(fmt.Sprintf("reexec func already registred under name %q", name))
|
||||
panic(fmt.Sprintf("reexec func already registered under name %q", name))
|
||||
}
|
||||
|
||||
registeredInitializers[name] = initializer
|
||||
|
|
|
@ -15,7 +15,7 @@ var (
|
|||
ErrNoSuchKey = errors.New("provided key does not exist")
|
||||
)
|
||||
|
||||
// Registrar stores indexes a list of keys and their registered names as well as indexes names and the key that they are registred to
|
||||
// Registrar stores indexes a list of keys and their registered names as well as indexes names and the key that they are registered to
|
||||
// Names must be unique.
|
||||
// Registrar is safe for concurrent access.
|
||||
type Registrar struct {
|
||||
|
|
|
@ -24,7 +24,7 @@ func IsShortID(id string) bool {
|
|||
// TruncateID returns a shorthand version of a string identifier for convenience.
|
||||
// A collision with other shorthands is very unlikely, but possible.
|
||||
// In case of a collision a lookup with TruncIndex.Get() will fail, and the caller
|
||||
// will need to use a langer prefix, or the full-length Id.
|
||||
// will need to use a longer prefix, or the full-length Id.
|
||||
func TruncateID(id string) string {
|
||||
if i := strings.IndexRune(id, ':'); i >= 0 {
|
||||
id = id[i+1:]
|
||||
|
@ -57,7 +57,7 @@ func generateID(crypto bool) string {
|
|||
}
|
||||
}
|
||||
|
||||
// GenerateRandomID returns an unique id.
|
||||
// GenerateRandomID returns a unique id.
|
||||
func GenerateRandomID() string {
|
||||
return generateID(true)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ func GenerateRandomAlphaOnlyString(n int) string {
|
|||
return string(b)
|
||||
}
|
||||
|
||||
// GenerateRandomASCIIString generates an ASCII random stirng with length n.
|
||||
// GenerateRandomASCIIString generates an ASCII random string with length n.
|
||||
func GenerateRandomASCIIString(n int) string {
|
||||
chars := "abcdefghijklmnopqrstuvwxyz" +
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
|
||||
|
@ -74,7 +74,7 @@ func quote(word string, buf *bytes.Buffer) {
|
|||
}
|
||||
|
||||
// ShellQuoteArguments takes a list of strings and escapes them so they will be
|
||||
// handled right when passed as arguments to an program via a shell
|
||||
// handled right when passed as arguments to a program via a shell
|
||||
func ShellQuoteArguments(args []string) string {
|
||||
var buf bytes.Buffer
|
||||
for i, arg := range args {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
// Umask sets current process's file mode creation mask to newmask
|
||||
// and return oldmask.
|
||||
// and returns oldmask.
|
||||
func Umask(newmask int) (oldmask int, err error) {
|
||||
return syscall.Umask(newmask), nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue