未验证 提交 64918f80 编写于 作者: X Xiaofan 提交者: GitHub

[skip ci] change CONTRIBUTING.mad to add go code style (#7817)

Signed-off-by: Nxiaofan-luan <xiaofan.luan@zilliz.com>
上级 2e575cb9
......@@ -70,7 +70,14 @@ $ git commit -s -m 'This is my commit message'
```
## Coding Style
The coding style used in Milvus generally follow [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
Keeping a consistent style for code, code comments, commit messages, and PR descriptions will greatly accelerate your PR review process. We highly recommend you refer to and comply to the following style guides when you put together your pull requests:
###GO
- Coding style: refer to the [Effictive Go Style Guide](https://golang.org/doc/effective_go)
###C++
The c++ coding style used in Milvus generally follow [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
And we made the following changes based on the guide:
- 4 spaces for indentation
......@@ -78,8 +85,16 @@ And we made the following changes based on the guide:
- 120-character line length
- Camel-Cased file names
### Commits and PRs
- Commit message and PR description style: refer to [good commit messages](https://chris.beams.io/posts/git-commit)
### Format code
####GO
```shell
$ make fmt
```
####C++
Install clang-format
```shell
$ sudo apt-get install clang-format
......@@ -96,9 +111,14 @@ $ make clang-format
```
## Run unit test with code coverage
Before submitting your Pull Request, make sure you have run unit test, and your code coverage rate is >= 90%.
###GO
```shell
$ go test -coverprofile fmtcoverage.html ./internal/allocator
ok github.com/milvus-io/milvus/internal/allocator 0.048s coverage: 69.6% of statements
```
###C++
Install lcov
```shell
$ sudo apt-get install lcov
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册