just started using modules, what have i missed?.

398 views
Skip to first unread message

simon place

unread,
May 2, 2024, 1:17:03 PM5/2/24
to golang-nuts
simon@fedora:~$ go get github.com/vulkan-go/vulkan
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'.
simon@fedora:~$ go install github.com/vulkan-go/vulkan
go: 'go install' requires a version when current directory is not in a module
Try 'go install github.com/vulkan-go/vulkan@latest' to install the latest version
simon@fedora:~$ go install github.com/vulkan-go/vulkan@latest
package github.com/vulkan-go/vulkan is not a main package
simon@fedora:~$ go get github.com/vulkan-go/vulkan@latest
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'.
simon@fedora:~$


so, i guess, i can make a dummy package that imports what i want, then  init + tidy + get and erase it all! if this is it, then a simple script is needed, but surely im missing something.

to me you need a lib package, with its documentation, first, in order to try/test alternatives.

Carla Pfaff

unread,
May 2, 2024, 2:31:53 PM5/2/24
to golang-nuts
It's not clear what your end goal is. github.com/vulkan-go/vulkan is a library. Do you want to use it as a dependency in one of your projects or not? If you want to use it as a dependency, then yes, "go mod init <name>" your project first before adding a dependency with "go get".

simon place

unread,
May 2, 2024, 5:38:55 PM5/2/24
to golang-nuts
thanks for the reply, yes a library, that i want to investigate, i don't have a project until after. this is whats ive been doing for years, but in 1.22 seems this way of working has stopped being supported.

burak serdar

unread,
May 2, 2024, 5:45:55 PM5/2/24
to simon place, golang-nuts
You can simply clone the github repo. You don't need go get for this.
When you're ready, import it and then go mod tidy.
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/2475eb7d-d065-49b3-b488-cd53ab75a3e1n%40googlegroups.com.

simon place

unread,
May 2, 2024, 6:20:51 PM5/2/24
to golang-nuts
On Thursday 2 May 2024 at 22:45:55 UTC+1 burak serdar wrote:
You can simply clone the github repo. You don't need go get for this.
When you're ready, import it and then go mod tidy.


ummm, could be the best way, i'll compare with the script, (dummy) route.

Reply all
Reply to author
Forward
0 new messages