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: add golangci-lint setup action and fix lint issue #592

Merged
merged 1 commit into from
May 28, 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
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ^1.22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to your change but related to my other comment

#592 (comment)

Here you can use "stable" it will always use the latest version and you don't have to maintain it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but it has downsides as well. It may be "easier" to maintain but may break all the users of the project, which has a bigger impact than just change the version in every few months. See https://vsupalov.com/docker-latest-tag/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but it has downsides as well. It may be "easier" to maintain but may break all the users of the project, which has a bigger impact than just change the version in every few months. See https://vsupalov.com/docker-latest-tag/

Very good read, I get it.


- name: Build
run: make build
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip: You could have used "latest" so you don't have to maintain it

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi, Same reply from the other comment, but i'll throw in tools like renovate exist so you can automate updating things, while keeping consistent build experience.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure dependabot cannot touch this argument of an action. It can bump the action version. But not its argument.

But maybe renovate can do it, so it would be fine

- name: Install dependency
run: if [ $(uname) == "Darwin" ]; then brew install gnu-sed ;fi
- name: Build
run: make build
- name: Run unit tests
run: go install github.com/go-delve/delve/cmd/dlv@latest && go test ./... -v -covermode=count -coverprofile=coverage.txt
- name: Upload Coverage report to CodeCov
Expand Down
2 changes: 1 addition & 1 deletion runner/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewProxy(cfg *cfgProxy) *Proxy {
Addr: fmt.Sprintf(":%d", cfg.ProxyPort),
},
client: &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
return http.ErrUseLastResponse
},
},
Expand Down
Loading