google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.26k stars 204 forks source link

Fix build instructions for Go 1.18+ #412

Closed ankitpati closed 1 year ago

ankitpati commented 1 year ago

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

I’m unable to run the REPL by following the build instructions in the README.md, but using go install instead of go get works for me:

$ podman run --pull always -it --rm docker.io/library/golang:latest
root@445c025009b7:/go# go version
go version go1.18.4 linux/amd64
root@445c025009b7:/go# starlark
bash: starlark: command not found
root@445c025009b7:/go# go get -u go.starlark.net/cmd/starlark
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'.
root@445c025009b7:/go# go install go.starlark.net/cmd/starlark@latest
go: downloading go.starlark.net v0.0.0-20220714194419-4cadf0a12139
go: downloading github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
go: downloading golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f
root@445c025009b7:/go# starlark
Welcome to Starlark (go.starlark.net)
>>> ^D
ankitpati commented 1 year ago

Thank you for the merge!