codefresh-io / go-sdk

Codefresh SDK for Golang
Apache License 2.0
11 stars 3 forks source link

sdk doesn't work with recent golang #390

Open mindlace opened 2 years ago

mindlace commented 2 years ago

with golang 1.17.3:

$ go get -u github.com/codefresh-io/go-sdk
go: downloading gopkg.in/yaml.v2 v2.2.4
go: downloading github.com/olekukonko/tablewriter v0.0.5
go: downloading github.com/mattn/go-runewidth v0.0.13
go: downloading github.com/rivo/uniseg v0.2.0
go get: installing executables with 'go get' in module mode is deprecated.
    Use 'go install pkg@version' instead.
    For more information, see https://golang.org/doc/go-get-install-deprecation
    or run 'go help get' or 'go help install'.
miquella commented 2 years ago

@mindlace: I actually believe this is a warning, not an error.

It used to be that Go executables (i.e. main packages) were installed using go get …, but that invocation has been deprecated and replaced with go install …@… instead.

I just tested this in a fresh repo using the -d flag (which tells Go you're not trying to install the main package, you're just trying to reference the module):

$ go get -d github.com/codefresh-io/go-sdk@latest
go: downloading github.com/codefresh-io/go-sdk v0.37.4
go: downloading gopkg.in/yaml.v2 v2.2.4
go: downloading github.com/google/go-querystring v1.1.0
go: added github.com/codefresh-io/go-sdk v0.37.4
go: added github.com/google/go-querystring v1.1.0
go: added github.com/mattn/go-runewidth v0.0.4
go: added github.com/olekukonko/tablewriter v0.0.1
go: added gopkg.in/yaml.v2 v2.2.4
$

Note: I am unaffiliated with CodeFresh, just happened across your issue for a different reason :smiley: