Crocsx
Crocsx

Reputation: 7620

godotenv command not found after setup

On my mac, I installed go, and setup a REPO from github that use godotenv.

I got the package using

go get github.com/joho/godotenv/cmd/godotenv

and run a script

godotenv -f .env bee run -main=./cmd/web/main.go -runmode=local

This return

godotenv: command not found

My PATH is setup

MacTests-MacBook-Air:dooh_frontend mactest$ go env PATH

MacTests-MacBook-Air:dooh_frontend mactest$ go env GOPATH
/Users/mactest/go

and inside go/bin I do see the godotenv

What am I missing ?

Upvotes: 1

Views: 2543

Answers (1)

Daniel Taub
Daniel Taub

Reputation: 5379

Add this to your .bashrc/.zshrc file

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

The go env variables isn't relevant to the shell env vars.

Upvotes: 7

Related Questions