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

'go get' installation process fails - is deprecated in go #238

Closed
therealbenturnbull opened this issue Sep 9, 2022 · 2 comments · Fixed by #239
Closed

'go get' installation process fails - is deprecated in go #238

therealbenturnbull opened this issue Sep 9, 2022 · 2 comments · Fixed by #239

Comments

@therealbenturnbull
Copy link

Running the installation command go get github.com/edgedb/edgedb-goon a clean system does not work.

It produces the following error:

'go get' is no longer supported outside a module.
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'.

go version produces the following:
go version go1.18.4 darwin/arm64

Googling says the following:
Starting in Go 1.17, installing executables with go get is deprecated. go install may be used instead. In Go 1.18, go get will no longer build packages; it will only be used to add, update, or remove dependencies in go. mod . Specifically, go get will always act as if the -d flag were enabled.

I might be missing something, but I can't get go install to work with the obvious solutions.

Can the documentation please be updated to help people new to Go?

@fmoor
Copy link
Member

fmoor commented Sep 9, 2022

Thanks for sharing your experience! This is helpful.

Ok so go install is for installing programs that you would use in your command line. However github.com/edgedb/edgedb-go is not a program. It is a library. To use it in your project you first have to initialize the go project (module) with

go mod init github.com/therealbentrunbull/my-project

Then in the directory where you ran go mod init you can run

go get github.com/edgedb/edgedb-go

Which adds it as a dependency to your module.

I'll add something to the docs about this.

fmoor added a commit that referenced this issue Sep 9, 2022
colinhacks added a commit that referenced this issue Sep 9, 2022
* Mention that go get should be run in a g module

fixes #238

* update wording

Co-authored-by: Colin McDonnell <colin@edgedb.com>
@therealbenturnbull
Copy link
Author

That's great! Thanks!
It will help people (like me) who are still new to this.

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

Successfully merging a pull request may close this issue.

2 participants