Merge pull request #1205 from YuPengZTE/devError

fix typos by the result of golint checking
This commit is contained in:
Qiang Huang 2017-01-27 21:42:18 +08:00 committed by GitHub
commit ed2df2906b
3 changed files with 10 additions and 10 deletions

View File

@ -24,7 +24,7 @@ type event struct {
// stats is the runc specific stats structure for stability when encoding and decoding stats. // stats is the runc specific stats structure for stability when encoding and decoding stats.
type stats struct { type stats struct {
Cpu cpu `json:"cpu"` CPU cpu `json:"cpu"`
Memory memory `json:"memory"` Memory memory `json:"memory"`
Pids pids `json:"pids"` Pids pids `json:"pids"`
Blkio blkio `json:"blkio"` Blkio blkio `json:"blkio"`
@ -198,13 +198,13 @@ func convertLibcontainerStats(ls *libcontainer.Stats) *stats {
s.Pids.Current = cg.PidsStats.Current s.Pids.Current = cg.PidsStats.Current
s.Pids.Limit = cg.PidsStats.Limit s.Pids.Limit = cg.PidsStats.Limit
s.Cpu.Usage.Kernel = cg.CpuStats.CpuUsage.UsageInKernelmode s.CPU.Usage.Kernel = cg.CpuStats.CpuUsage.UsageInKernelmode
s.Cpu.Usage.User = cg.CpuStats.CpuUsage.UsageInUsermode s.CPU.Usage.User = cg.CpuStats.CpuUsage.UsageInUsermode
s.Cpu.Usage.Total = cg.CpuStats.CpuUsage.TotalUsage s.CPU.Usage.Total = cg.CpuStats.CpuUsage.TotalUsage
s.Cpu.Usage.Percpu = cg.CpuStats.CpuUsage.PercpuUsage s.CPU.Usage.Percpu = cg.CpuStats.CpuUsage.PercpuUsage
s.Cpu.Throttling.Periods = cg.CpuStats.ThrottlingData.Periods s.CPU.Throttling.Periods = cg.CpuStats.ThrottlingData.Periods
s.Cpu.Throttling.ThrottledPeriods = cg.CpuStats.ThrottlingData.ThrottledPeriods s.CPU.Throttling.ThrottledPeriods = cg.CpuStats.ThrottlingData.ThrottledPeriods
s.Cpu.Throttling.ThrottledTime = cg.CpuStats.ThrottlingData.ThrottledTime s.CPU.Throttling.ThrottledTime = cg.CpuStats.ThrottlingData.ThrottledTime
s.Memory.Cache = cg.MemoryStats.Cache s.Memory.Cache = cg.MemoryStats.Cache
s.Memory.Kernel = convertMemoryEntry(cg.MemoryStats.KernelUsage) s.Memory.Kernel = convertMemoryEntry(cg.MemoryStats.KernelUsage)

View File

@ -496,7 +496,7 @@ func badPrefix(fpath string) error {
for _, prefix := range badprefixes { for _, prefix := range badprefixes {
if fpath == prefix || strings.HasPrefix(fpath, fmt.Sprintf("%s/", prefix)) { 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 return nil

View File

@ -43,7 +43,7 @@ var rlimitMap = map[string]int{
func strToRlimit(key string) (int, error) { func strToRlimit(key string) (int, error) {
rl, ok := rlimitMap[key] rl, ok := rlimitMap[key]
if !ok { if !ok {
return 0, fmt.Errorf("Wrong rlimit value: %s", key) return 0, fmt.Errorf("wrong rlimit value: %s", key)
} }
return rl, nil return rl, nil
} }