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 github.com/brianvoe/gofakeit/v5 giving error #88

Closed
simsolTech opened this issue Apr 26, 2020 · 13 comments
Closed

go get github.com/brianvoe/gofakeit/v5 giving error #88

simsolTech opened this issue Apr 26, 2020 · 13 comments

Comments

@simsolTech
Copy link

Error: cannot find package "github.com/brianvoe/gofakeit/v5"

Go get github.com/brianvoe/gofakeit is pulling the code. But throwing error :

goserver1 % go get github.com/brianvoe/gofakeit

internal/race

compile: version "go1.14" does not match go tool version "go1.14.2"

unicode/utf8

compile: version "go1.14" does not match go tool version "go1.14.2"

runtime/internal/sys

compile: version "go1.14" does not match go tool version "go1.14.2"

math/bits

compile: version "go1.14" does not match go tool version "go1.14.2"

unicode

compile: version "go1.14" does not match go tool version "go1.14.2"

encoding

compile: version "go1.14" does not match go tool version "go1.14.2"

unicode/utf16

compile: version "go1.14" does not match go tool version "go1.14.2"

image/color

compile: version "go1.14" does not match go tool version "go1.14.2"

github.com/brianvoe/gofakeit/data

compile: version "go1.14" does not match go tool version "go1.14.2"

sync/atomic

compile: version "go1.14" does not match go tool version "go1.14.2"

internal/cpu

compile: version "go1.14" does not match go tool version "go1.14.2"

runtime/internal/atomic

compile: version "go1.14" does not match go tool version "go1.14.2"

@brianvoe
Copy link
Owner

Im sorry this is a little out of my wheel house of expertise. If you find out the issue im more than willing to fix it if it is indeed a gofakeit issue.

@simsolTech
Copy link
Author

simsolTech commented Apr 27, 2020 via email

@p3ym4n
Copy link

p3ym4n commented Apr 27, 2020

@simsolTech your solution not working for me.

this error shows up in my ci:

imports github.com/brianvoe/gofakeit/v5
imports github.com/brianvoe/gofakeit/v5/data: cannot find package "." in:
/MY-PROJECT-PATH/vendor/github.com/brianvoe/gofakeit/v5/data

@PumpkinSeed
Copy link

PumpkinSeed commented Apr 27, 2020

go.dev registered the package as v5, so it should work with go get properly.

@p3ym4n Can you tell details what scripts are running in the CI which has this result please?

@p3ym4n
Copy link

p3ym4n commented Apr 27, 2020

@PumpkinSeed actually I don't know why it's throwing this problem, I'm investigating to find out.

BTW my CI script is just a simple go test ./... command in a golang:1.14.0 container.

@brianvoe
Copy link
Owner

You can comment on this later if you find out what your issue it. but im going to close this for now considering i dont think its a gofakeit issue.

@simsolTech
Copy link
Author

simsolTech commented Apr 28, 2020

Work around:
You need to do perform the following:

  1. go get github.com/brianvoe/gofakeit -> This places your code in 'github.com./brianvoe/gofakeit'
  2. Rename 'github.com/brianvoe/gofakeit' to 'github.com/brianvoe/v5' -> Now you have "github.com/brianvoe/v5"
  3. make a directory 'gofakeit' in github.com/brianvoe/ -> Now you have two folders in github.com/brianvoe i.e, "gofakeit" and "v5"
  4. Move v5 folder into gofakeit -> Final directory structure is "gofakeit' in github.com/brianvoe/gofakeit.v5/......"
  5. import "github.com/brianvoe/gofakeit" in your code

Suggested solution:

  1. Replace all instances of "gofakeit' in github.com/brianvoe/gofakeit.v5" in code files with "gofakeit' in github.com/brianvoe/gofakeit" in the library
  2. Change installation instructions to "go get install "github.com/brianvoe/gofakeit"

@brianvoe
Copy link
Owner

The only way i can see this being true is if your not using go mods.

@simsolTech
Copy link
Author

You are right. It goes of with go mod.

Thanks. Best regards
Deepak

@p3ym4n
Copy link

p3ym4n commented Mar 21, 2021

I just found the root cause of the issue I was encountering, maybe for others who may end up here.
we had added a data line in our .gitignore file on the root of our project which results in not including the /data folder of this package when we commit our code into the repo. so in the CI steps, this package was damaged.

@PumpkinSeed
Copy link

@p3ym4n Probably you using the vendor folder instead of doing the go get in the CI. Probably if you don't have a specific reason to hold the vendor folder alongside of your project it's better to add the vendor to gitignore and doing go get in the CI.

@p3ym4n
Copy link

p3ym4n commented Mar 21, 2021

Yes @PumpkinSeed, but I prefer to keep the vendor folder in the repo to prevent calling the go get on each step of the CI.
and that issue was so weird :)

@brianvoe
Copy link
Owner

Glad you found your issue!

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

No branches or pull requests

4 participants