From 017c9f9cbc0cacdee0c56bb8a6d9848c43159d53 Mon Sep 17 00:00:00 2001 From: mingrammer Date: Mon, 18 Mar 2019 02:52:26 +0900 Subject: [PATCH] Fix typos --- disk/disk_unix.go | 2 +- docker/docker_linux.go | 2 +- host/host_linux.go | 2 +- host/host_test.go | 4 ++-- mem/mem_freebsd.go | 2 +- net/net_darwin.go | 2 +- net/net_freebsd.go | 2 +- net/net_openbsd.go | 2 +- process/process_linux.go | 2 +- process/process_test.go | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/disk/disk_unix.go b/disk/disk_unix.go index 9b499b5..86ab99c 100644 --- a/disk/disk_unix.go +++ b/disk/disk_unix.go @@ -9,7 +9,7 @@ import ( "golang.org/x/sys/unix" ) -// Usage returns a file system usage. path is a filessytem path such +// Usage returns a file system usage. path is a filesystem path such // as "/", not device file path like "/dev/vda1". If you want to use // a return value of disk.Partitions, use "Mountpoint" not "Device". func Usage(path string) (*UsageStat, error) { diff --git a/docker/docker_linux.go b/docker/docker_linux.go index 3f5a361..f3015c5 100644 --- a/docker/docker_linux.go +++ b/docker/docker_linux.go @@ -269,7 +269,7 @@ func CgroupMemDockerWithContext(ctx context.Context, containerID string) (*Cgrou return CgroupMem(containerID, common.HostSys("fs/cgroup/memory/docker")) } -// getCgroupFilePath constructs file path to get targetted stats file. +// getCgroupFilePath constructs file path to get targeted stats file. func getCgroupFilePath(containerID, base, target, file string) string { if len(base) == 0 { base = common.HostSys(fmt.Sprintf("fs/cgroup/%s/docker", target)) diff --git a/host/host_linux.go b/host/host_linux.go index 508d8c9..03b3407 100644 --- a/host/host_linux.go +++ b/host/host_linux.go @@ -657,7 +657,7 @@ func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, err label = fmt.Sprintf("%s_", strings.Join(strings.Split(strings.TrimSpace(strings.ToLower(string(c))), " "), "")) } - // Get the name of the tempearture you are reading + // Get the name of the temperature you are reading name, err := ioutil.ReadFile(filepath.Join(filepath.Dir(file), "name")) if err != nil { return temperatures, err diff --git a/host/host_test.go b/host/host_test.go index a05c230..1b34f69 100644 --- a/host/host_test.go +++ b/host/host_test.go @@ -143,7 +143,7 @@ func TestKernelVersion(t *testing.T) { t.Errorf("KernelVersion() failed, %v", err) } if version == "" { - t.Errorf("KernelVersion() retuns empty: %s", version) + t.Errorf("KernelVersion() returns empty: %s", version) } t.Logf("KernelVersion(): %s", version) @@ -155,7 +155,7 @@ func TestPlatformInformation(t *testing.T) { t.Errorf("PlatformInformation() failed, %v", err) } if platform == "" { - t.Errorf("PlatformInformation() retuns empty: %v", platform) + t.Errorf("PlatformInformation() returns empty: %v", platform) } t.Logf("PlatformInformation(): %v, %v, %v", platform, family, version) diff --git a/mem/mem_freebsd.go b/mem/mem_freebsd.go index 387581a..f91efc9 100644 --- a/mem/mem_freebsd.go +++ b/mem/mem_freebsd.go @@ -100,7 +100,7 @@ type xswdev struct { Used int32 // Used is the number of blocks used } -// xswdev11 is a compatiblity for under FreeBSD 11 +// xswdev11 is a compatibility for under FreeBSD 11 // sys/vm/swap_pager.c type xswdev11 struct { Version uint32 // Version is the version diff --git a/net/net_darwin.go b/net/net_darwin.go index 0d89280..1d941a0 100644 --- a/net/net_darwin.go +++ b/net/net_darwin.go @@ -42,7 +42,7 @@ func parseNetstatLine(line string) (stat *IOCountersStat, linkID *uint, err erro base := 1 numberColumns := len(columns) - // sometimes Address is ommitted + // sometimes Address is omitted if numberColumns < 12 { base = 0 } diff --git a/net/net_freebsd.go b/net/net_freebsd.go index ce02415..f811f8b 100644 --- a/net/net_freebsd.go +++ b/net/net_freebsd.go @@ -45,7 +45,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, continue } base := 1 - // sometimes Address is ommitted + // sometimes Address is omitted if len(values) < 13 { base = 0 } diff --git a/net/net_openbsd.go b/net/net_openbsd.go index 3e74e8f..0faa70e 100644 --- a/net/net_openbsd.go +++ b/net/net_openbsd.go @@ -41,7 +41,7 @@ func ParseNetstat(output string, mode string, continue } base := 1 - // sometimes Address is ommitted + // sometimes Address is omitted if len(values) < columns { base = 0 } diff --git a/process/process_linux.go b/process/process_linux.go index cdf27f7..8ae99ff 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -186,7 +186,7 @@ func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { // Return value could be one of these. // R: Running S: Sleep T: Stop I: Idle // Z: Zombie W: Wait L: Lock -// The charactor is same within all supported platforms. +// The character is same within all supported platforms. func (p *Process) Status() (string, error) { return p.StatusWithContext(context.Background()) } diff --git a/process/process_test.go b/process/process_test.go index 0d51837..5dcc6be 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -357,7 +357,7 @@ func Test_Connections(t *testing.T) { t.Fatalf("error %v", err) } // TODO: - // Since go test open no conneciton, ret is empty. + // Since go test open no connection, ret is empty. // should invoke child process or other solutions. if len(c) != 0 { t.Fatalf("wrong connections")