I am trying to learn how to build a webserver using go and mux. I am importing mux to the main.go file as import github.com/gorilla/mux
. However, when I am trying to run the code. I get the following error
no required module provides package github.com/gorilla/mux: go.mod file not found in current directory or any parent directory; see 'go help modules'
My GOPATH is /Users/michiokaku/Study/go
The overall structure of my directories is
go___
pkg
bin
my_codes___
main.go
Inside pkg, I found a directory named mux@v1.8.0 in the path pkg/mod/github.com/gorilla
. I think this is what I downloaded using go get -u github.com/gorilla/mux
. But when the code is running, I am getting errors.
What is the issue here? How do I solve this?
PS: I am using mac.