Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 go get isn't working in v2. #788

Closed
ghost opened this issue Sep 15, 2020 · 10 comments
Closed

🐛 go get isn't working in v2. #788

ghost opened this issue Sep 15, 2020 · 10 comments

Comments

@ghost
Copy link

ghost commented Sep 15, 2020

Fiber version
v2
Issue description
I tried installing fiber with the g
import "github.com/gofiber/fiber/v2"
go get command and it is not working, go get -u or the go modules are also of no help.
Code snippet

package main
func main() {
  app := fiber.New()

  // Steps to reproduce

  log.Fatal(app.Listen(":3000"))
}

Screenshot from 2020-09-15 23-48-25

@ghost ghost added the ☢️ Bug label Sep 15, 2020
@welcome
Copy link

welcome bot commented Sep 15, 2020

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@ReneWerner87
Copy link
Member

ReneWerner87 commented Sep 15, 2020

please try this

go clean -cache -modcache -i -r

article: https://lecstor.com/go-clear-cache/

image
it runs on my machine

@Fenny
Copy link
Member

Fenny commented Sep 15, 2020

Try to initiate a go.mod and run go mod tidy after you imported v2 in your project.

image

image

@ghost ghost closed this as completed Sep 15, 2020
@tbdsux
Copy link

tbdsux commented Sep 18, 2020

I had this problem with me.

What i did is remove the gofiber package or folders from the src and pkg folder.

Then check the go env. Set the GO111MODULE=on (My machine didn't set it automatically.)

Do not use the go get cause it will not work. Go to your project directory, then...
Screenshot from 2020-09-18 21-40-37

@eternity-wing
Copy link

eternity-wing commented Sep 18, 2020

I had the

I had this problem with me.

What i did is remove the gofiber package or folders from the src and pkg folder.

Then check the go env. Set the GO111MODULE=on (My machine didn't set it automatically.)

Do not use the go get cause it will not work. Go to your project directory, then...
Screenshot from 2020-09-18 21-40-37

Actually I am totally a newbee in Golang and I didn't know that I should use go mod init ... before starting a new project, and after wasting couple of hours found the problem.

@hrzp
Copy link

hrzp commented Sep 20, 2020

In ubuntu I just do this:

export GO111MODULE=on
go get github.com/gofiber/fiber/v2

before doing this, be sure that your .profile variables set like this:

open your profile:
sudo nano ~/.profile
if you put the golang to /usr/local/go
then edit the .profile like this:

export GOPATH=$HOME/work
export GOROOT=/usr/local/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

@Metrakit
Copy link

Same issue here. Good to know that @hzrp. Now its work. Why we shoud enable this tag for download the last version ? In a fresh Gitlab CI pipeline i have this issue

@felipetesc
Copy link

I had the same problem, than I have installed with the command go get -u github.com/gofiber/fiber on Ubuntu 20.04 and the version 2 was correctly installed. (no v2)

@aminabvaal
Copy link

I had the same problem, than I have installed with the command go get -u github.com/gofiber/fiber on Ubuntu 20.04 and the version 2 was correctly installed. (no v2)

yes you right and i do it

@Tazeg
Copy link
Contributor

Tazeg commented Dec 25, 2020

In ubuntu I just do this:

export GO111MODULE=on
go get github.com/gofiber/fiber/v2

before doing this, be sure that your .profile variables set like this:

open your profile:
sudo nano ~/.profile
if you put the golang to /usr/local/go
then edit the .profile like this:

export GOPATH=$HOME/work
export GOROOT=/usr/local/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

No sudo needed about a file in your home directory.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants