Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
  • Loading branch information
kakkoyun committed May 13, 2022
1 parent 67603df commit 6d8c316
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: sudo apt-get install llvm libelf-dev

- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.0
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.0

- name: Install gofumpt
run: go install mvdan.cc/gofumpt@latest
Expand Down
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ linters:
- unused
disable:
- exhaustivestruct
- exhaustruct
- funlen
- gci
- gochecknoglobals
Expand All @@ -30,6 +31,7 @@ linters:
- lll
- maligned
- nlreturn
- nonamedreturns
- paralleltest
- scopelint
- testpackage
Expand Down
6 changes: 3 additions & 3 deletions pkg/profiler/profiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ type bpfMaps struct {
}

func (m bpfMaps) clean(stacks []int32, logger log.Logger) {
for _, stackId := range stacks {
err := m.stacks.DeleteKey(unsafe.Pointer(&stackId))
for _, stackID := range stacks {
err := m.stacks.DeleteKey(unsafe.Pointer(&stackID))
if err != nil {
if !errors.Is(err, syscall.ENOENT) {
// Continuing in case of an error as we still want to delete the rest of the
Expand Down Expand Up @@ -546,7 +546,7 @@ func (p *CgroupProfiler) profileLoop(ctx context.Context, captureTime time.Time)
// The capacity will be difficult to estimate without counting as it's
// likely that there will be more than we need due to duplicated stack IDs.
stacksKeySlice := make([]int32, 0, len(stacksKeys))
for key, _ := range stacksKeys {
for key := range stacksKeys {
stacksKeySlice = append(stacksKeySlice, key)
}

Expand Down

0 comments on commit 6d8c316

Please sign in to comment.