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

unable to download course material in GOPATH #66

Open
puneet336 opened this issue Feb 28, 2023 · 1 comment
Open

unable to download course material in GOPATH #66

puneet336 opened this issue Feb 28, 2023 · 1 comment

Comments

@puneet336
Copy link

puneet336 commented Feb 28, 2023

I am using centos 7.

[puneets@server1]~/MyWork/experiments/exp2>export GOPATH=$PWD/
[puneets@server1]~/MyWork/experiments/exp2>ls
[puneets@server1]~/MyWork/experiments/exp2>
[puneets@server1]~/MyWork/experiments/exp2>
[puneets@server1]~/MyWork/experiments/exp2>mkdir bin src pkg
[puneets@server1]~/MyWork/experiments/exp2>ls
bin  pkg  src
[puneets@server1]~/MyWork/experiments/exp2>go get -d github.com/GoesToEleven/GolangTraining/...
go: go.mod file not found in current directory or any parent directory.
        'go get' is no longer supported outside a module.
        To build and install a command, use 'go install' with a version,
        like 'go install example.com/cmd@latest'
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.
[puneets@server1]~/MyWork/experiments/exp2>go mod init github.com/test
go: creating new go.mod: module github.com/test
go: to add module requirements and sums:
        go mod tidy
[puneets@server1]~/MyWork/experiments/exp2>go get -d github.com/GoesToEleven/GolangTraining/...
$GOPATH/go.mod exists but should not

Why GO is not allowing me download course material in workspace?
Did i miss anything here?
Is there a way to download course material in $PWD or $GOPATH ?

@joelket23
Copy link

You have to first do go init "GitHub.com/username/anything" before you can use go get

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

2 participants