title: go no required module provides package mux error
body: <p>so I have the following code,</p>
  <pre><code>package main
  import (
      &quot;github.com/gorilla/mux&quot;
  )
  func main() {
      router := mux.NewRouter()
  }
  </code></pre>
  <p>when I do go run ., it gives the following error
  <code>binapi.go:4:2: no required module provides package github.com/gorilla/mux; to add it: go get github.com/gorilla/mux</code>, how do I fix this error? I have run the go get github.com/gorilla/mux command in every way possible and im sure it is installed. I found a post a while back but the command it gave didn't work. The command was go env -w GO111MODULE=auto but it didnt solve the issue.</p>
  <p>here is the go env</p>
  <pre><code>GO111MODULE=&quot;auto&quot;
  GOARCH=&quot;amd64&quot;
  GOBIN=&quot;&quot;
  GOCACHE=&quot;/Users/ProfMonkey07/Library/Caches/go-build&quot;
  GOENV=&quot;/Users/ProfMonkey07/Library/Application Support/go/env&quot;
  GOEXE=&quot;&quot;
  GOEXPERIMENT=&quot;&quot;
  GOFLAGS=&quot;&quot;
  GOHOSTARCH=&quot;amd64&quot;
  GOHOSTOS=&quot;darwin&quot;
  GOINSECURE=&quot;&quot;
  GOMODCACHE=&quot;/Users/ProfMonkey07/go/pkg/mod&quot;
  GONOPROXY=&quot;&quot;
  GONOSUMDB=&quot;&quot;
  GOOS=&quot;darwin&quot;
  GOPATH=&quot;/Users/ProfMonkey07/go&quot;
  GOPRIVATE=&quot;&quot;
  GOPROXY=&quot;https://proxy.golang.org,direct&quot;
  GOROOT=&quot;/usr/local/go&quot;
  GOSUMDB=&quot;sum.golang.org&quot;
  GOTMPDIR=&quot;&quot;
  GOTOOLDIR=&quot;/usr/local/go/pkg/tool/darwin_amd64&quot;
  GOVCS=&quot;&quot;
  GOVERSION=&quot;go1.17.6&quot;
  GCCGO=&quot;gccgo&quot;
  AR=&quot;ar&quot;
  CC=&quot;clang&quot;
  CXX=&quot;clang++&quot;
  CGO_ENABLED=&quot;1&quot;
  GOMOD=&quot;/Users/ProfMonkey07/binapi/go.mod&quot;
  CGO_CFLAGS=&quot;-g -O2&quot;
  CGO_CPPFLAGS=&quot;&quot;
  CGO_CXXFLAGS=&quot;-g -O2&quot;
  CGO_FFLAGS=&quot;-g -O2&quot;
  CGO_LDFLAGS=&quot;-g -O2&quot;
  PKG_CONFIG=&quot;pkg-config&quot;
  GOGCCFLAGS=&quot;-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8g/ssbpssj956ncjflh7w2k4w5m0000gn/T/go-build2892181555=/tmp/go-build -gno-record-gcc-switches -fno-common&quot;
  </code></pre>