On Mon, May 6, 2024 at 9:40 AM 'simon place' via golang-nuts <golang-nuts@googlegroups.com> wrote: > > OK, i had thought, (without understanding why), you can't/don't install > non-main packages, as the error message says. ( as mentioned in previous post) > > simon@fedora:~$ go install github.com/vulkan-go/vulkan@latest > package github.com/vulkan-go/vulkan is not a main package > > but it works sometimes? (still error message) > > simon@fedora:~$ go install github.com/xyproto/png2svg@latest > go: downloading github.com/xyproto/png2svg v1.5.4 > go: downloading github.com/xyproto/tinysvg v1.1.0 > package github.com/xyproto/png2svg is not a main package > > and why not install the latest if not specified anyway?
It didn't work either time. In the second case it just did some other stuff before noticing. Before modules, it made sense to "go install" a non-main package: that would build the package and set it up to be imported by other packages. With modules, though, it doesn't make any sense. The go.mod file specifies exactly what version of a non-main package to use. And the compiled form of packages is stored in the package cache. Installing a non-main package isn't going to affect how anything else is built. For a while it was available essentially a no-op. Now it gets an error. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWzX5OkMXz_i7aSf7QXZagY1daDv4FpQa17d4XZv4Yniw%40mail.gmail.com.