I would like to learn how effectively we can design a go package. it would be great help if you provide me some documentation or design Techniques
1 Like
Will effective go helps? It has all the rules, structure, practices, etc. in it.
Something important is to use go module
over the classical distribution methods like GOPATH
and vendor
. Documentations are available at:
- https://github.com/golang/go/wiki/Modules
- https://blog.golang.org/using-go-modules
- https://blog.golang.org/migrating-to-go-modules
We normally have tools that handle all the systematic practices on-the-job like:
-
go fmt
that handles source codes formatting. -
golangci-lint
that handles all sort of static analysis. - advanced
go test
(with coverage, etc.)
If you need to model some references:
- https://github.com/kubernetes/kubernetes
-
https://github.com/golang/go/tree/master/src (make sure it is inside
src
, since go package discourage the use ofsrc
)
If you want, you can read up some additional materials:
- https://dave.cheney.net/practical-go/presentations/qcon-china.html - some good practices
- https://sites.google.com/view/chewkeanho/guides/go/testing - setting up test tools
1 Like
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.