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

[proposal] Conventional code formatting style. #332

Open
tttoad opened this issue Dec 27, 2024 · 0 comments
Open

[proposal] Conventional code formatting style. #332

tttoad opened this issue Dec 27, 2024 · 0 comments

Comments

@tttoad
Copy link

tttoad commented Dec 27, 2024

I use gopls to format the code.

I habitually format files when I modify code, which creates many changes.
example:

var (
errAlreadyStarted = errors.New("already started")
)
const defaultOpAMPPath = "/v1/opamp"
const headerContentType = "Content-Type"
const headerContentEncoding = "Content-Encoding"
const headerAcceptEncoding = "Accept-Encoding"
const contentEncodingGzip = "gzip"
const contentTypeProtobuf = "application/x-protobuf"

Format to:

var errAlreadyStarted = errors.New("already started")

const (
	defaultOpAMPPath      = "/v1/opamp"
	headerContentType     = "Content-Type"
	headerContentEncoding = "Content-Encoding"
	headerAcceptEncoding  = "Accept-Encoding"
	contentEncodingGzip   = "gzip"
	contentTypeProtobuf   = "application/x-protobuf"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant