Summary: How to Write Go Code

Summary: How to Write Go Code

  1. The code organization follows repository -> module -> packages.
  2. Use go mod init and initialize module root as desired e.g.
  3. The Go binary goes to the path set in GOBIN
  4. All imported modules are stored in GOPATH/pkg/mod subdirectory
  5. The command go clean -modcache cleans downloaded packages.


Written with StackEdit.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: