Conversation
hehaifengcn
approved these changes
Jun 23, 2025
temporal-nick
approved these changes
Jun 23, 2025
Collaborator
|
FYI, build failed: go get -tool -modfile=develop/tools.mod golang.org/x/tools/cmd/goimports@latest
flag provided but not defined: -tool
usage: go get [-t] [-u] [-v] [build flags] [packages]
Run 'go help get' for details.
make: *** [Makefile:3[7](https://github.com/temporalio/s2s-proxy/actions/runs/15831199136/job/44624016012?pr=100#step:4:8): update-tools] Error 2 |
e708ce3 to
2e88d90
Compare
pglass
commented
Jun 24, 2025
| enable: | ||
| - gci | ||
| settings: | ||
| gci: |
Contributor
Author
There was a problem hiding this comment.
Switched to https://github.com/daixiang0/gci for code formatting. I've seen a couple other teams use this. It does a better job of grouping imports than goimport does.
goimports doesn't merge two import groups if they are adjacent, and it allows import groups to be in any order
import (
"github.com/hashicorp/yamux"
"go.temporal.io/server/common/backoff"
"github.com/temporalio/s2s-proxy/config" // <<<
"github.com/temporalio/s2s-proxy/encryption" // <<<
"github.com/temporalio/s2s-proxy/metrics"
"fmt"
"net"
While with gci, it will sort and merge into a minimum number of import groups:
import (
"fmt"
"net"
"github.com/hashicorp/yamux"
"go.temporal.io/server/common/backoff"
"github.com/temporalio/s2s-proxy/config"
"github.com/temporalio/s2s-proxy/encryption"
"github.com/temporalio/s2s-proxy/metrics"
pglass
commented
Jun 24, 2025
| # Lint target | ||
| # Refer to .golangci.yml for configuration options | ||
| fmt: | ||
| $(GO_TOOL) golangci-lint fmt |
Contributor
Author
There was a problem hiding this comment.
Switch to use golangci-lint fmt, which supports a few different standard formatters out of the box (so one fewer thing to install): https://golangci-lint.run/usage/formatters/#goimports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
Why?
Checklist
Closes
How was this tested: