If we need a code style?
- Dominant language
- Go
- Stars
- 5k
- Forks
- 1k
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 29
Description
**What would you like to be added**:
Good Code Style.
**Why is this needed**:
1. Standardized code promotes teamwork
2. Standardized code can reduce bug handling
3. Standardized code can reduce maintenance costs
4. Standardized code helps code review
**How**:
Although golang does not have a recognized code specification, we can refer to those:
https://go.dev/ref/spec
https://github.com/golang/go/wiki/CodeReviewComments
https://github.com/uber-go/guide/blob/master/style.md
e.g.
```go
var localIp string
func GetLocalIp() string {
}
```
into
```go
var localIP string
func GetLocalIP() string {
}
```
```go
type Service struct {
name string
rcvr reflect.Value
rcvrType reflect.Type
methods map[string]*MethodType
}
```
into
```go
type Service struct {
name string
rv reflect.Value // receiveValue
rt reflect.Type // receiveType
methods map[string]*MethodType
}
```
Contributor guide
Research direction
Start by reading the Go specification, CodeReviewComments, and Uber Go Style Guide linked in the issue, then compare them with the repository's current conventions. No target files or tests are named; done would require an agreed project-wide style and consistent application across the affected code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- developer-experience
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100