Posted on | 216 words | ~2 mins
CodeProject dotnet java javascript node node nodejs

installation and setup

GOROOT src bin

Source Code Structure


TODO definition of a module


TODO definition of a packge

The go.mod File


go 1.20


Note that if using:

protoc --go_out=. --go-grpc_out=. --go-grpc_opt=paths=source_relative proto/*.proto

You will spit out a folder tree like, to omit this tree and use relative paths, include the options below:

protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative proto/*.proto

" Press ? for help

.. (up a dir) </dwmkerr/repos/golang/jac/ ▾ jac.pb.go jac_grpc.pb.go ▾ proto/ jac.proto ▾ server/ main.go

For developing applications:

  • Code directory in home
  • Can do it in any folder
  • To make it public, use the github url, e.g.
  • one top level module, e.g. ‘jac’, then the subfolders are packages
  • (For reference, multi-module workspaces might be worth looking at)

If I do for example:

mkdir ~/repos/golang/jac
cd ~/repos/golang/jac
go mod init

Now when I import:

import (
    "" // is would download from github

If I did go mod get then I can download the package locally, or go mod install to

go mod

go mod
go mod tidy
  • vendor directory
  • code organisation
  • where to run go mod
  • what is go.mod
  • most simple folder structure


Anything with lowercase is private, anything starting with Uppercase is public and exported

Client / Server

Simple echo server