The following column will share with you some notes on Go naming conventions from the Golang Language Tutorial column. I hope it will be helpful to friends in need!
camelCase
ServeHTTP
i, j, k
cust
instead of customer
var tt []*Thingfor i, t := range tt { ... }
log.Info() // good log.LogInfo() // bad
getters
or setters
are named like this: custSvc.cust() // good custSvc.getCust() // bad
er
to the interfacetype Stringer interfaces { String() string }
For more golang technical articles, please visit the golang tutorial column!
The above is the detailed content of Share some notes on Go naming conventions. For more information, please follow other related articles on the PHP Chinese website!