Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert linting changes #332

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading