Coder Social home page Coder Social logo

$GOPATH is not working about goenv HOT 6 CLOSED

grantstephens avatar grantstephens commented on May 21, 2024 5
$GOPATH is not working

from goenv.

Comments (6)

blockloop avatar blockloop commented on May 21, 2024 8

The change is described in the commit message of f9a06ed. @grantstephens you need to export GOENV_DISABLE_GOPATH=1 before eval "$(goenv init -)"

Here's my rc

export GOENV_DISABLE_GOPATH=1
export GOENV_VERSION=$(goenv versions --bare | tail -n1)
export GOPATH="$HOME/go"
eval "$(goenv init -)"
goenv global "${GOENV_VERSION}"

from goenv.

syndbg avatar syndbg commented on May 21, 2024 2

@grantstephens @d-kuro @blockloop Hey, my takeaway from the issue is that the documentation was lacking since you had to check the commit to better understand the usage.

I've added the GOPATH and GOROOT-related env vars to https://github.com/syndbg/goenv/blob/master/ENVIRONMENT_VARIABLES.md

I think it's resolving the issue. What do you think?

P.S I've referenced your comment @blockloop . Cool usage of export GOENV_VERSION=$(goenv versions --bare | tail -n1) :)

from goenv.

d-kuro avatar d-kuro commented on May 21, 2024 1

@syndbg thanks!

from goenv.

timhughes avatar timhughes commented on May 21, 2024 1

@blockloop @syndbg you may want to add a sort in there by version.

$ goenv versions --bare
1.10.2
1.11.0
1.5.4

When you have pre 1.10 versions you get the following which is quite obviously wrong

$ goenv versions --bare | tail -n1
1.5.4

But sort has the ability to sort by semver (at least on linux it does)

$ goenv versions --bare|sort --version-sort
1.5.4
1.10.2
1.11.0

So you then get what you are after

$ goenv versions --bare|sort --version-sort|tail -n1
1.11.0

Opened a issue for this #81

from goenv.

syndbg avatar syndbg commented on May 21, 2024

Thanks! I'll check it out and verify

from goenv.

d-kuro avatar d-kuro commented on May 21, 2024

I use fish shell, solved this by deleting eval (goenv init-| source) which I wrote in fish.config

from goenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.