Fiber: 馃悰 go get isn't working in v2.

Created on 15 Sep 2020  路  10Comments  路  Source: gofiber/fiber

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

馃 Question

Most helpful comment

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)

All 10 comments

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

please try this

go clean -cache -modcache -i -r

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

image
it runs on my machine

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

image

image

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

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.

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

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

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)

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahan picture ahan  路  3Comments

lucasmdomingues picture lucasmdomingues  路  3Comments

bashery picture bashery  路  4Comments

renatojf picture renatojf  路  3Comments

mayowa picture mayowa  路  3Comments