Skip to content

Commit 1e56c6f

Browse files
committed
Spelling and grammar fixes
1 parent 696bb11 commit 1e56c6f

17 files changed

+34
-34
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

2929

3030
-------
31-
internal/common/binary.go in the gopsutil is copied and modifid from golang/encoding/binary.go.
31+
internal/common/binary.go in the gopsutil is copied and modified from golang/encoding/binary.go.
3232

3333

3434

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ challenge is porting all psutil functions on some architectures.
77

88
## v3 migration
99

10-
from v3.20.10, gopsutil becomes v3 which breaks backwards compatiblity.
10+
from v3.20.10, gopsutil becomes v3 which breaks backwards compatibility.
1111
See [v3Changes.md](_tools/v3migration/v3Changes.md) more detail changes.
1212

1313
## Tag semantics
@@ -21,7 +21,7 @@ for example, v2.17.04 means
2121
- 17: release year, 2017
2222
- 04: release month
2323

24-
gopsutil aims to keep backwards-compatiblity until major version change.
24+
gopsutil aims to keep backwards compatibility until major version change.
2525

2626
Tagged at every end of month, but if there are only a few commits, it
2727
can be skipped.
@@ -229,7 +229,7 @@ Some code is ported from Ohai. many thanks.
229229
|**HostInfo** | | | | | | |
230230
|hostname |x |x |x |x |x |x |
231231
|uptime |x |x |x |x | |x |
232-
|proces |x |x |x | | |x |
232+
|process |x |x |x | | |x |
233233
|os |x |x |x |x |x |x |
234234
|platform |x |x |x |x | |x |
235235
|platformfamily |x |x |x |x | |x |

docker/docker_linux.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func GetDockerStatWithContext(ctx context.Context) ([]CgroupDockerStat, error) {
5757
return ret, nil
5858
}
5959

60-
// GetDockerIDList returnes a list of DockerID.
60+
// GetDockerIDList returns a list of DockerID.
6161
// This requires certain permission.
6262
func GetDockerIDList() ([]string, error) {
6363
return GetDockerIDListWithContext(context.Background())
@@ -86,15 +86,15 @@ func GetDockerIDListWithContext(ctx context.Context) ([]string, error) {
8686
return ret, nil
8787
}
8888

89-
// CgroupCPU returnes specified cgroup id CPU status.
89+
// CgroupCPU returns specified cgroup id CPU status.
9090
// containerID is same as docker id if you use docker.
9191
// If you use container via systemd.slice, you could use
9292
// containerID = docker-<container id>.scope and base=/sys/fs/cgroup/cpuacct/system.slice/
9393
func CgroupCPU(containerID string, base string) (*CgroupCPUStat, error) {
9494
return CgroupCPUWithContext(context.Background(), containerID, base)
9595
}
9696

97-
// CgroupCPUUsage returnes specified cgroup id CPU usage.
97+
// CgroupCPUUsage returns specified cgroup id CPU usage.
9898
// containerID is same as docker id if you use docker.
9999
// If you use container via systemd.slice, you could use
100100
// containerID = docker-<container id>.scope and base=/sys/fs/cgroup/cpuacct/system.slice/

docker/docker_notlinux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func GetDockerStatWithContext(ctx context.Context) ([]CgroupDockerStat, error) {
1919
return nil, ErrDockerNotAvailable
2020
}
2121

22-
// GetDockerIDList returnes a list of DockerID.
22+
// GetDockerIDList returns a list of DockerID.
2323
// This requires certain permission.
2424
func GetDockerIDList() ([]string, error) {
2525
return GetDockerIDListWithContext(context.Background())
@@ -29,7 +29,7 @@ func GetDockerIDListWithContext(ctx context.Context) ([]string, error) {
2929
return nil, ErrDockerNotAvailable
3030
}
3131

32-
// CgroupCPU returnes specified cgroup id CPU status.
32+
// CgroupCPU returns specified cgroup id CPU status.
3333
// containerid is same as docker id if you use docker.
3434
// If you use container via systemd.slice, you could use
3535
// containerid = docker-<container id>.scope and base=/sys/fs/cgroup/cpuacct/system.slice/

internal/common/common.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (i Invoke) CommandWithContext(ctx context.Context, name string, arg ...stri
6464

6565
type FakeInvoke struct {
6666
Suffix string // Suffix species expected file name suffix such as "fail"
67-
Error error // If Error specfied, return the error.
67+
Error error // If Error specified, return the error.
6868
}
6969

7070
// Command in FakeInvoke returns from expected file if exists.

load/load_darwin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func AvgWithContext(ctx context.Context) (*AvgStat, error) {
3939
return ret, nil
4040
}
4141

42-
// Misc returnes miscellaneous host-wide statistics.
42+
// Misc returns miscellaneous host-wide statistics.
4343
// darwin use ps command to get process running/blocked count.
4444
// Almost same as FreeBSD implementation, but state is different.
4545
// U means 'Uninterruptible Sleep'.

load/load_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func fileAvgWithContext() (*AvgStat, error) {
6868
return ret, nil
6969
}
7070

71-
// Misc returnes miscellaneous host-wide statistics.
71+
// Misc returns miscellaneous host-wide statistics.
7272
// Note: the name should be changed near future.
7373
func Misc() (*MiscStat, error) {
7474
return MiscWithContext(context.Background())

mem/mem_linux.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func fillFromMeminfoWithContext() (*VirtualMemoryStat, *VirtualMemoryExStat, err
305305

306306
if !memavail {
307307
if activeFile && inactiveFile && sReclaimable {
308-
ret.Available = calcuateAvailVmem(ret, retEx)
308+
ret.Available = calculateAvailVmem(ret, retEx)
309309
} else {
310310
ret.Available = ret.Cached + ret.Free
311311
}
@@ -387,10 +387,10 @@ func SwapMemoryWithContext(ctx context.Context) (*SwapMemoryStat, error) {
387387
return ret, nil
388388
}
389389

390-
// calcuateAvailVmem is a fallback under kernel 3.14 where /proc/meminfo does not provide
390+
// calculateAvailVmem is a fallback under kernel 3.14 where /proc/meminfo does not provide
391391
// "MemAvailable:" column. It reimplements an algorithm from the link below
392392
// https://github.com/giampaolo/psutil/pull/890
393-
func calcuateAvailVmem(ret *VirtualMemoryStat, retEx *VirtualMemoryExStat) uint64 {
393+
func calculateAvailVmem(ret *VirtualMemoryStat, retEx *VirtualMemoryExStat) uint64 {
394394
var watermarkLow uint64
395395

396396
fn := common.HostProc("zoneinfo")

net/net_aix.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat,
105105
return iocounters, nil
106106
}
107107

108-
// NetIOCountersByFile is an method which is added just a compatibility for linux.
108+
// IOCountersByFile exists just for compatibility with Linux.
109109
func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) {
110110
return IOCountersByFileWithContext(context.Background(), pernic, filename)
111111
}

net/net_darwin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat,
257257
return ret, nil
258258
}
259259

260-
// NetIOCountersByFile is an method which is added just a compatibility for linux.
260+
// IOCountersByFile exists just for compatibility with Linux.
261261
func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) {
262262
return IOCountersByFileWithContext(context.Background(), pernic, filename)
263263
}

net/net_freebsd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat,
9595
return ret, nil
9696
}
9797

98-
// NetIOCountersByFile is an method which is added just a compatibility for linux.
98+
// IOCountersByFile exists just for compatibility with Linux.
9999
func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) {
100100
return IOCountersByFileWithContext(context.Background(), pernic, filename)
101101
}

net/net_linux.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ( // Conntrack Column numbers
4040
ctSEARCH_RESTART
4141
)
4242

43-
// NetIOCounters returnes network I/O statistics for every network
43+
// NetIOCounters returns network I/O statistics for every network
4444
// interface installed on the system. If pernic argument is false,
4545
// return only sum of all information (which name is 'all'). If true,
4646
// every network interface installed on the system is returned
@@ -188,7 +188,7 @@ func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoC
188188
line := lines[i]
189189
r := strings.IndexRune(line, ':')
190190
if r == -1 {
191-
return nil, errors.New(filename + " is not fomatted correctly, expected ':'.")
191+
return nil, errors.New(filename + " is not formatted correctly, expected ':'.")
192192
}
193193
proto := strings.ToLower(line[:r])
194194
if !protos[proto] {
@@ -204,7 +204,7 @@ func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoC
204204
i++
205205
statValues := strings.Split(lines[i][r+2:], " ")
206206
if len(statNames) != len(statValues) {
207-
return nil, errors.New(filename + " is not fomatted correctly, expected same number of columns.")
207+
return nil, errors.New(filename + " is not formatted correctly, expected same number of columns.")
208208
}
209209
stat := ProtoCountersStat{
210210
Protocol: proto,
@@ -539,7 +539,7 @@ func statsFromInodes(root string, pid int32, tmap []netConnectionKindType, inode
539539
return ret, nil
540540
}
541541

542-
// getProcInodes returnes fd of the pid.
542+
// getProcInodes returns fd of the pid.
543543
func getProcInodes(root string, pid int32, max int) (map[string][]inodeMap, error) {
544544
ret := make(map[string][]inodeMap)
545545

net/net_openbsd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat,
139139
return ret, nil
140140
}
141141

142-
// NetIOCountersByFile is an method which is added just a compatibility for linux.
142+
// IOCountersByFile exists just for compatibility with Linux.
143143
func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) {
144144
return IOCountersByFileWithContext(context.Background(), pernic, filename)
145145
}

net/net_windows.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat,
200200
return counters, nil
201201
}
202202

203-
// NetIOCountersByFile is an method which is added just a compatibility for linux.
203+
// IOCountersByFile exists just for compatibility with Linux.
204204
func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) {
205205
return IOCountersByFileWithContext(context.Background(), pernic, filename)
206206
}

process/process.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ type Process struct {
4747
const (
4848
// Running marks a task a running or runnable (on the run queue)
4949
Running = "running"
50-
// Blocked marks a task waiting on a short, uninterruptable operation (usually IO)
50+
// Blocked marks a task waiting on a short, uninterruptible operation (usually I/O)
5151
Blocked = "blocked"
5252
// Idle marks a task sleeping for more than about 20 seconds
5353
Idle = "idle"
5454
// Lock marks a task waiting to acquire a lock
5555
Lock = "lock"
56-
// Sleep marks task waiting for short, interruptable operation
56+
// Sleep marks task waiting for short, interruptible operation
5757
Sleep = "sleep"
5858
// Stop marks a stopped process
5959
Stop = "stop"
@@ -230,7 +230,7 @@ func (p *Process) BackgroundWithContext(ctx context.Context) (bool, error) {
230230
}
231231

232232
// If interval is 0, return difference from last call(non-blocking).
233-
// If interval > 0, wait interval sec and return diffrence between start and end.
233+
// If interval > 0, wait interval sec and return difference between start and end.
234234
func (p *Process) Percent(interval time.Duration) (float64, error) {
235235
return p.PercentWithContext(context.Background(), interval)
236236
}

process/process_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ func (p *Process) fillFromLimitsWithContext() ([]RlimitStat, error) {
526526
// Assert that last item is a Hard limit
527527
statItem.Hard, err = limitToUint(str[len(str)-1])
528528
if err != nil {
529-
// On error remove last item an try once again since it can be unit or header line
529+
// On error remove last item and try once again since it can be unit or header line
530530
str = str[:len(str)-1]
531531
statItem.Hard, err = limitToUint(str[len(str)-1])
532532
if err != nil {

process/process_windows.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ type winLUIDAndAttributes struct {
189189
}
190190

191191
// TOKEN_PRIVILEGES
192-
type winTokenPriviledges struct {
192+
type winTokenPrivileges struct {
193193
PrivilegeCount winDWord
194194
Privileges [1]winLUIDAndAttributes
195195
}
@@ -218,23 +218,23 @@ func init() {
218218
}
219219
defer token.Close()
220220

221-
tokenPriviledges := winTokenPriviledges{PrivilegeCount: 1}
221+
tokenPrivileges := winTokenPrivileges{PrivilegeCount: 1}
222222
lpName := syscall.StringToUTF16("SeDebugPrivilege")
223223
ret, _, _ := procLookupPrivilegeValue.Call(
224224
0,
225225
uintptr(unsafe.Pointer(&lpName[0])),
226-
uintptr(unsafe.Pointer(&tokenPriviledges.Privileges[0].Luid)))
226+
uintptr(unsafe.Pointer(&tokenPrivileges.Privileges[0].Luid)))
227227
if ret == 0 {
228228
return
229229
}
230230

231-
tokenPriviledges.Privileges[0].Attributes = 0x00000002 // SE_PRIVILEGE_ENABLED
231+
tokenPrivileges.Privileges[0].Attributes = 0x00000002 // SE_PRIVILEGE_ENABLED
232232

233233
procAdjustTokenPrivileges.Call(
234234
uintptr(token),
235235
0,
236-
uintptr(unsafe.Pointer(&tokenPriviledges)),
237-
uintptr(unsafe.Sizeof(tokenPriviledges)),
236+
uintptr(unsafe.Pointer(&tokenPrivileges)),
237+
uintptr(unsafe.Sizeof(tokenPrivileges)),
238238
0,
239239
0)
240240
}

0 commit comments

Comments
 (0)