apache / apache/dubbo-go

If we need a code style?

Open
#1,755 4 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.