-
Create your workspace
$ mkdir -p go-mod
-
$ go mod init hello
for create new hello module. -
Add example package to
go.mod
by addingrequire github.com/sirupsen/logrus v1.1.1
. -
Create
main.go
-
Build the project
go build
-
You will see the log like this.
-
go: finding github.com/sirupsen/logrus v1.1.1 go: finding github.com/davecgh/go-spew v1.1.1 go: finding github.com/stretchr/testify v1.2.2 go: finding github.com/pmezard/go-difflib v1.0.0 go: finding github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe go: finding golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 go: finding golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 go: downloading github.com/sirupsen/logrus v1.1.1 go: downloading golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 go: downloading golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33
-
./hello
In your $GOPATH.