ibm-cloud-docs / cloud-object-storage

cloud-object-storage
15 stars 46 forks source link

"go get" is deprecated, replaced by "go install" #179

Closed marc3977 closed 8 months ago

marc3977 commented 8 months ago

In this page, it says to use the following command to install the SDK:

go get github.com/IBM/ibm-cos-sdk-go

However, go get is deprecated and replaced by go install.

kaloriaibm commented 8 months ago

The COS SDK is not an executable thus go get is still applicable. Deprecation of 'go get' for installing executables. https://go.dev/doc/go-get-install-deprecation

marc3977 commented 8 months ago

If I follow the instructions as-is, it doesn't work though:

PS C:\Users\011993649> go get github.com/IBM/ibm-cos-sdk-go
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'.
IBMalok commented 8 months ago

@marc3977 - can you try setting it? - go env -w GO111MODULE=auto

It works for me -


alokmgr@Aloks-MacBook-Pro IBM % go version
go version go1.21.5 darwin/amd64
alokmgr@Aloks-MacBook-Pro IBM % ls 
alokmgr@Aloks-MacBook-Pro IBM % go get github.com/IBM/ibm-cos-sdk-go
alokmgr@Aloks-MacBook-Pro IBM % ls
ibm-cos-sdk-go
alokmgr@Aloks-MacBook-Pro IBM %