Skip to content

Commit

Permalink
fix: revert linting changes (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-primrose authored May 21, 2024
1 parent 9365153 commit 60e62db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ linters:
- dogsled
# - dupl
- durationcheck
- errcheck
# - errcheck
- errorlint
- exhaustive
- exportloopref
Expand Down Expand Up @@ -98,7 +98,7 @@ linters:
# - revive
- rowserrcheck
- sqlclosecheck
- staticcheck
# - staticcheck
# - structcheck
# - stylecheck
- tparallel
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ linters:
- dogsled
# - dupl
- durationcheck
- errcheck
# - errcheck
- errorlint
- exhaustive
- exportloopref
Expand Down Expand Up @@ -98,7 +98,7 @@ linters:
# - revive
- rowserrcheck
- sqlclosecheck
- staticcheck
# - staticcheck
# - structcheck
# - stylecheck
- tparallel
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ if err != nil {

# Dev tips for passing CI Checks

- Ensure code is formatted correctly with `gofmt -s -w ./`
- Install gofumpt `go install mvdan.cc/gofumpt@latest` (replaces gofmt)
- Install gci `go install github.com/daixiang0/gci@latest` (organizes imports)
- Ensure code is formatted correctly with `gofumpt -l -w -extra ./`
- Ensure code is gci'd with `gci.exe write --skip-generated -s standard -s default .`
- Ensure all unit tests pass with `go test ./...`
- Ensure code has been gci'd with `gci.exe write --skip-generated -s standard -s default .`
- Ensure code has been linted with `docker run --rm -v ${pwd}:/app -w /app golangci/golangci-lint:latest golangci-lint run -v`
10 changes: 2 additions & 8 deletions pkg/wsman/client/wsman_tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,8 @@ func (t *Target) Receive() ([]byte, error) {
return nil, fmt.Errorf("no active connection")
}

item := t.bufferPool.Get()

tmp, ok := item.([]byte)
if !ok {
return nil, fmt.Errorf("failed to get buffer from pool")
}

defer t.bufferPool.Put(&tmp)
tmp := t.bufferPool.Get().([]byte)
defer t.bufferPool.Put(tmp)

n, err := t.conn.Read(tmp)
if err != nil {
Expand Down

0 comments on commit 60e62db

Please sign in to comment.