Import Function form package

I thought it was going to be similar to many languages and I will just have to just do something like:

import "mypakckage/Myfuction"

Well… no, first it will depend on your GOPATH, which is handled differently depending of your go version. Secondly, In golang exported function must be in Uppercase, otherwise it won’t compile!

First module

So I chose the easiest that I could find first to structure project by creating a module.

Create a go module:

go mod init

It will create a go.mod file like so:


go 1.16

And then I could finally do

import ""