grpc.io icon indicating copy to clipboard operation
grpc.io copied to clipboard

Quick start - can only use path@version syntax with 'go get'

Open Kaszanas opened this issue 4 years ago • 7 comments

The issue surfaced when attempting to perform the steps that are outlined in: https://grpc.io/docs/languages/go/quickstart/#prerequisites

During the installation of prerequisites following the instructions in order to get gRPC working with Golang when using the following command:

go install google.golang.org/protobuf/cmd/[email protected]

I was met with an error as follows:

package google.golang.org/protobuf/cmd/[email protected]: can only use path@version syntax with 'go get'

After performing the go get google.golang.org/protobuf/cmd/[email protected] command as suggested by the language tooling the issue went away. The same issue exists for the second installation command in the instructions:

go install google.golang.org/grpc/cmd/[email protected]

I am not sure if this is language version specific or not. The language version I use is: go version go1.15.1 windows/amd64 I will send a PR with the change applied.

Kaszanas avatar Jul 30 '21 11:07 Kaszanas

Related: #682, #708 -- which change from get to install.

chalin avatar Jul 30 '21 11:07 chalin

And thanks for submitting the issue @Kaszanas!

chalin avatar Jul 30 '21 11:07 chalin

This then seems to be language version-specific and one might think about including the cut-off point as to which language versions should use which commands.

This in order would present the problem of docs getting bloated, and as You only support the three latest major versions of Golang it seems like this issue is unnecessary.

I do not require any further assistance as I have resolved this issue on my system. Thank You for quick response @chalin

Kaszanas avatar Jul 30 '21 11:07 Kaszanas

The supported releases of Go are 1.14, 1.15, and 1.16. So you are in that range. I'd be curious to hear what @dfawley has to say about this. I'll reopen the issue and let Doug close it if he believes there isn't any action to take.

chalin avatar Jul 30 '21 13:07 chalin

Re: get/install: https://golang.org/doc/go-get-install-deprecation

Looks like Go 1.16 added support for @version: https://golang.org/doc/go1.16#go-command, so we probably stick with get at least until 1.18 is released and 1.16 is the oldest version we support (unless the Go team breaks go get support before then - it will be functional in 1.17 at least).

dfawley avatar Aug 02 '21 17:08 dfawley

Seems then that this could be resolved by effectively introducing two commands for installation and mentioning which versions of Golang require which command to be run. Example below:

Installation

Depending on Your current Golang version please use one of the commands below in order to install the library.

Using Golang < 1.15

go get google.golang.org/protobuf/cmd/[email protected]

Using Golang > 1.15

go install google.golang.org/protobuf/cmd/[email protected]

Kaszanas avatar Aug 06 '21 22:08 Kaszanas

Shall we also include this into the 'Quick start' Section for Go inside the documentation?

I guess that almost every gopher jumped onto 1.18 since generics has been introduced with this Go Version, but maybe just for the sake of completeness 😄

PatrickLaabs avatar Jun 02 '22 08:06 PatrickLaabs