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. example.com/user/hello
  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.

Reference

Written with StackEdit.

BlinkBlank

Knowledge is the seed of wisdom.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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.