woogabeen
woogabeen

Reputation: 33

trouble installing "gorilla/mux" in golang

So I installed gorilla/mux to use it for my API by typing this code on terminal

go get -u github.com/gorilla/mux

And since it didn't return any errors (nor any texts) I thought the install was successful. But When I started to use "mux. "something, vscode showed that the name "mux" is not declared. Does anyone had any similar experience or know how to solve the problem? Thanks in advance.

(Using go1.18.3)

Upvotes: 1

Views: 1003

Answers (2)

anjiri1684
anjiri1684

Reputation: 1

You need to have go installed in your local machine

  1. run go mod init githum.com
  2. run go get - u github.com/gorilla/mux

Upvotes: 0

Malik Mussabeheen Noor
Malik Mussabeheen Noor

Reputation: 864

Your project doesn't have go.sum file.

Run go mod tidy and you will be good to go.

Upvotes: 1

Related Questions