Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: jason yang <[email protected]>
  • Loading branch information
JasonYangShadow committed Oct 23, 2023
1 parent 5fe3352 commit 6bb6fc4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ linters:
- errcheck
- thelper
- usestdlibvars
- protogetter
- deadcode
- varcheck
- structcheck

linters-settings:
goheader:
Expand Down
2 changes: 1 addition & 1 deletion internal/cgroup/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

type Marshal interface {
Marshal(*bytes.Buffer) (*bytes.Buffer, error)
Marshal(buffer *bytes.Buffer) (*bytes.Buffer, error)
}

type StatManager struct {
Expand Down
12 changes: 6 additions & 6 deletions internal/cgroup/parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ func TestParser(t *testing.T) {
require.Len(t, allFuncs, 5)

usage := allFuncs[0]()
require.Equal(t, 0.0, usage["cpu_usage_per"])
require.InEpsilon(t, 0.01, usage["cpu_usage_per"], 1)

usage = allFuncs[1]()
require.Equal(t, 0.0, usage["memory_usage_per"])
require.InEpsilon(t, 0.01, usage["memory_usage_per"], 1)

usage = allFuncs[2]()
require.Equal(t, 0.0, usage["memory_swap_usage_per"])
require.InEpsilon(t, 0.01, usage["memory_swap_usage_per"], 1)

usage = allFuncs[3]()
require.Equal(t, 0.0, usage["pid_usage_per"])
require.InEpsilon(t, 0.01, usage["pid_usage_per"], 1)

usage = allFuncs[4]()
require.Equal(t, 0.0, usage["blkio_read"])
require.Equal(t, 0.0, usage["blkio_write"])
require.InEpsilon(t, 0.01, usage["blkio_read"], 1)
require.InEpsilon(t, 0.01, usage["blkio_write"], 1)
}

0 comments on commit 6bb6fc4

Please sign in to comment.