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

Install error go get: need to use go install from version 1.8 #26

Closed
onigomex opened this issue Mar 21, 2022 · 2 comments · Fixed by #27
Closed

Install error go get: need to use go install from version 1.8 #26

onigomex opened this issue Mar 21, 2022 · 2 comments · Fixed by #27
Assignees
Labels
bug Something isn't working

Comments

@onigomex
Copy link
Owner

onigomex commented Mar 21, 2022

バグというより、仕様変更。
Go 1.8 より、go get ではなくて、go install を使って、go アプリはインストールしてねに変わったため、error になった。
ちなみに、go get は、go.mod の依存関係を調整することに特化するようになった。

a@as-macbook-air dotfiles % make install ROLE=vim
2022-03-21 15:15:30 [INFO] Install vim...
2022-03-21 15:15:30 [INFO] Install > homebrew...
2022-03-21 15:15:30 [INFO] Install > fzf...
2022-03-21 15:15:31 [INFO] Install > ripgrep...
2022-03-21 15:15:32 [INFO] Install > memo...
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'.
make: *** [install] Error 1
a@as-macbook-air dotfiles % go version
go version go1.18 darwin/amd64
@onigomex onigomex added the bug Something isn't working label Mar 21, 2022
@onigomex onigomex self-assigned this Mar 21, 2022
@onigomex
Copy link
Owner Author

仕様変更内容

Go command > go get

go get no longer builds or installs packages in module-aware mode. go get is now dedicated to adjusting dependencies in go.mod. Effectively, the -d flag is always enabled. To install the latest version of an executable outside the context of the current module, use go install example.com/cmd@latest. Any version query may be used instead of latest.

refs. Go 1.18 Release Notes - The Go Programming Language

横並びチェック

% pwd
/Users/xxx/src/github.com/onigiri10co/dotfiles

% rg 'go get'
roles/memo/install.sh
8:  go get github.com/mattn/memo

@onigomex
Copy link
Owner Author

version も指定する必要がある。

2022-03-21 16:29:02 [INFO] Install > memo...
go: 'go install' requires a version when current directory is not in a module
	Try 'go install github.com/mattn/memo@latest' to install the latest version
make: *** [install] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant