This commit was merged in pull request #161.
This commit is contained in:
1 parent
8c889fa622
commit
d673785d33
5 files changed
+49
-14
No files matched your search
@@ -1,13 +1,16 @@
|
||||
---
|
||||
title: Code Styleguide — Go
|
||||
last_modified: 2026-10-18
|
||||
last_modified: 2026-11-07
|
||||
---
|
||||
|
||||
1. Try to hard wrap long lines at 77 characters or less.
|
||||
1. Format Go code with `gofmt` and then `golines -m 77`, through `make fmt`.
|
||||
Don't commit anything `make fmt` would change. The only exception is when
|
||||
committing things that aren't yet syntactically valid, which should only
|
||||
happen pre-v0.0.1 or on a non-`main` branch.
|
||||
|
||||
1. Don't commit anything that hasn't been `go fmt`'d. The only exception is
|
||||
when committing things that aren't yet syntactically valid, which should
|
||||
only happen pre-v0.0.1 or on a non-`main` branch.
|
||||
1. Hard wrap long lines at 77 characters or less. `golines` does this for code.
|
||||
Wrap comments and long string literals by hand, since `golines` leaves them
|
||||
as they are.
|
||||
|
||||
1. Even if you are planning to deal with only positive integers, use
|
||||
`int`/`int64` types instead of `uint`/`uint64` types. This is for
|
||||
|
||||
Reference in new issue
Block a user