Skip to content

goenv not setting $GOPATH and $GOROOT on Apple M1 using ZSH #186

@envintus

Description

@envintus

I've followed the installation instructions in an attempt to setup goenv and have it manage $GOPATH and $GOROOT on my Apple M1 MacBook Pro.

I'm using ZSH as my shell and this is the contents of my .zshrc file.

export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$PATH"
eval "$(goenv init -)"
export PATH="$GOROOT/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"

After configuring .zshrc and restarting my shell this is what I see for Golang environment variables:

$ env | grep GO | sort
GOENV_ROOT=/Users/hsatterwhite/.goenv
GOENV_SHELL=zsh

For what it's worth I'm able to successfully use goenv to install Golang. I also have a non-M1 MacBook Pro that I did the same setup on using ZSH and had no issues with installation and having goenv manage $GOPATH and $GOROOT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions