raylib-goplus
raylib-goplus copied to clipboard
[QoL] Define a .mod file for raylib-goplus
The Current Issue Hello!
Thanks for your work on raylib-goplus; it's definitely a huge step in the right direction to automatically generate new bindings for raylib for Go.
When it comes to actually using raylib-goplus, I believe it would be more idiomatic to use Go Modules to allow projects that use this library to download and import it without having to manually run go get, and to make the status of projects that use it reproducible (because it refers to a specific version of a library that is known to work with the project).
The Paradigm to Match
Instead of running go get on a library (raylib-goplus, in this case), just importing it should have Go automatically download and include it in the project's go.mod file, due to the library having the go.mod file included.
The Proposal
To fix this, simply initialize a new module with the project's name / URL using go mod init and commit it to the root of the module. This will allow recent Go versions to automatically retrieve it from the URL specified, download it, and import it without issue.
Great suggestion. I will do this tonight (if I remember).
This now has been implemented
I believe there's an issue with the go.mod file...
EDIT: OK, I figured out why this wasn't working. You have multiple go.mod files in your subdirectories. There should only be one, in the base folder for the project. From that point, the folder structure indicates the packages; you specifically should not have multiple go.mod files in your project.
oooh, from the guide I was following, it suggested to use multiple go mod files. Alright, I will correct this now :)
Can you tell me which guide this is? Maybe it was talking about something else...?
https://github.com/go-modules-by-example/index/tree/master/009_submodules