Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "mkdir home/user permission denied" on go get command

Tags:

go

I have set the following environmental variables in .bashrc file

    export GOROOT=/usr/local/go
    export PATH=$PATH:$GOROOT/bin
    export GOPATH=/home/Rushikesh/GO
    export PATH=$PATH:$GOPATH/bin

When I run following command:

    go get github.com/nsf/gocode

I get the following error:

    package github.com/nsf/gocode: mkdir /home/Rushikesh: permission denied
like image 575
Rushikesh Sabde Avatar asked Sep 05 '25 03:09

Rushikesh Sabde


1 Answers

The problem is your configuration.

As reading form your comments Rushikesh is not user it is your directory. Then the GOPATH env variable should be

export GOPATH=/home/logged_user_name/Rushikesh/GO

like image 67
coolcoder Avatar answered Sep 07 '25 23:09

coolcoder