Coding guidelines

Coding Golang

We code in Go™ and strictly follow the best practices and will not accept any deviations. You must run the following tools against your Go code and fix all errors and warnings: - golint - go vet - goimports

API Documentation

The API documentation for Hyperledger Fabric’s Golang APIs is available in GoDoc.

Generating gRPC code

If you modify any .proto files, run the following command to generate/update the respective .pb.go files.

cd $GOPATH/src/
make protos

Adding or updating Go packages

Hyperledger Fabric uses Go Vendoring for package management. This means that all required packages reside in the $GOPATH/src/ folder. Go will use packages in this folder instead of the GOPATH when the go install or go build commands are executed. To manage the packages in the vendor folder, we use dep.