guptarohit / asciigraph

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
https://pkg.go.dev/github.com/guptarohit/asciigraph
BSD 3-Clause "New" or "Revised" License
2.68k stars 102 forks source link

How to install now that `go get` is deprecated #45

Closed luckman212 closed 1 year ago

luckman212 commented 1 year ago

This looks really neat. But I'm having trouble installing it. Anyone know of a workaround now that go get is deprecated?

go get

$ go get github.com/guptarohit/asciigraph
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'.

go install

$ go install github.com/guptarohit/asciigraph@latest
package github.com/guptarohit/asciigraph is not a main package
guptarohit commented 1 year ago

Hi @luckman212,

Thanks for bringing it to my attention. I've updated cli installation instruction in README, this should work for installing cli.

Otherwise, if you wanted to have it as dependency in your Go application then there has to be a go.mod file in your application before running go get command. Command to initialise go module: go mod init <module name>

Cheers!