From 145d23e084fb327aa93956682f70b862ba198c69 Mon Sep 17 00:00:00 2001 From: yupeng Date: Wed, 30 Nov 2016 16:07:13 +0800 Subject: [PATCH] error strings should not be capitalized or end with punctuation Signed-off-by: yupeng --- events.go | 16 ++++++++-------- libcontainer/selinux/selinux.go | 2 +- rlimit_linux.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/events.go b/events.go index 77cf5f54..8121c71d 100644 --- a/events.go +++ b/events.go @@ -24,7 +24,7 @@ type event struct { // stats is the runc specific stats structure for stability when encoding and decoding stats. type stats struct { - Cpu cpu `json:"cpu"` + CPU cpu `json:"cpu"` Memory memory `json:"memory"` Pids pids `json:"pids"` Blkio blkio `json:"blkio"` @@ -195,13 +195,13 @@ func convertLibcontainerStats(ls *libcontainer.Stats) *stats { s.Pids.Current = cg.PidsStats.Current s.Pids.Limit = cg.PidsStats.Limit - s.Cpu.Usage.Kernel = cg.CpuStats.CpuUsage.UsageInKernelmode - s.Cpu.Usage.User = cg.CpuStats.CpuUsage.UsageInUsermode - s.Cpu.Usage.Total = cg.CpuStats.CpuUsage.TotalUsage - s.Cpu.Usage.Percpu = cg.CpuStats.CpuUsage.PercpuUsage - s.Cpu.Throttling.Periods = cg.CpuStats.ThrottlingData.Periods - s.Cpu.Throttling.ThrottledPeriods = cg.CpuStats.ThrottlingData.ThrottledPeriods - s.Cpu.Throttling.ThrottledTime = cg.CpuStats.ThrottlingData.ThrottledTime + s.CPU.Usage.Kernel = cg.CpuStats.CpuUsage.UsageInKernelmode + s.CPU.Usage.User = cg.CpuStats.CpuUsage.UsageInUsermode + s.CPU.Usage.Total = cg.CpuStats.CpuUsage.TotalUsage + s.CPU.Usage.Percpu = cg.CpuStats.CpuUsage.PercpuUsage + s.CPU.Throttling.Periods = cg.CpuStats.ThrottlingData.Periods + s.CPU.Throttling.ThrottledPeriods = cg.CpuStats.ThrottlingData.ThrottledPeriods + s.CPU.Throttling.ThrottledTime = cg.CpuStats.ThrottlingData.ThrottledTime s.Memory.Cache = cg.MemoryStats.Cache s.Memory.Kernel = convertMemoryEntry(cg.MemoryStats.KernelUsage) diff --git a/libcontainer/selinux/selinux.go b/libcontainer/selinux/selinux.go index fcaba1d2..efb8d48b 100644 --- a/libcontainer/selinux/selinux.go +++ b/libcontainer/selinux/selinux.go @@ -458,7 +458,7 @@ func badPrefix(fpath string) error { for _, prefix := range badprefixes { if fpath == prefix || strings.HasPrefix(fpath, fmt.Sprintf("%s/", prefix)) { - return fmt.Errorf("Relabeling content in %s is not allowed.", prefix) + return fmt.Errorf("relabeling content in %s is not allowed", prefix) } } return nil diff --git a/rlimit_linux.go b/rlimit_linux.go index 0de8b0b2..c97a0fb4 100644 --- a/rlimit_linux.go +++ b/rlimit_linux.go @@ -43,7 +43,7 @@ var rlimitMap = map[string]int{ func strToRlimit(key string) (int, error) { rl, ok := rlimitMap[key] if !ok { - return 0, fmt.Errorf("Wrong rlimit value: %s", key) + return 0, fmt.Errorf("wrong rlimit value: %s", key) } return rl, nil }