-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Go] Add go.mod file #7720
[Go] Add go.mod file #7720
Conversation
This go.mod file is incorrect, isn't it? It specifies the module name as "github.com/google/flatbuffers", but the module name in all documentation is "github.com/google/flatbuffers/go". eg. https://pkg.go.dev/github.com/google/flatbuffers/go With this new go.mod file in place, now previously-working code is breaking with errors like
|
You're right. Sent out a fix at #7756. Thanks for reporting this! |
Thanks! |
@le-michael a tag prefixed with "go" must be provided such as "go/v0.1.0" or else automatic module finding by
|
It seems that after introducing the https://pkg.go.dev/github.com/google/flatbuffers The former has the correct version history and version on release while the latter is the new module and has an auto generated version derived from the version tag and commit id. Ideally, we'd want to introduce the I think we may have to revert this change to prevent the version history of our package on go.dev from getting messier and reintroduce the |
I don't understand exactly what's going on with the Go package mirroring. For some reason gazelle doesn't want to mirror the flatbuffers package. Possibly because we already have it defined in our workspace. Not sure. There's some magic somewhere that I don't have insight into. Regardless, we should explicitly point gazelle at our vendored version of flatbuffers. That's what this patch accomplishes. I think this was caused by google/flatbuffers#7756 or google/flatbuffers#7720, but I'm not sure. At least the timing matches. This patch effectively reverts Ibd850b77987625d359a38bf53d7db4ae9bc77dc2. Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com> Change-Id: I489d2150811bd00ab810a3038bbac2d0dc74ff6d
Co-authored-by: Derek Bailey <derekbailey@google.com>
In the last several days we are consistently getting
when trying to update dependencies with go get. Seems to be related to the double export in pkg.go.dev. |
@vitaly-eureka-security can you try removing the You should be able to update the dependency using We're planning to leave the go.mod file as is and we will start tagging the go subdirectory so that the module version matches the flatbuffer release version. |
@le-michael - thanks for the reply. I followed the instructions and removed the dependency.
Running
|
@vitaly-eureka-security I opened up an issue #7780 we can continue the discussion there. |
@vitaly-eureka-security should be fixed now. Please let me know if it's still broken. |
Thanks @le-michael - works like a charm! |
Co-authored-by: Derek Bailey <derekbailey@google.com>
Co-authored-by: Derek Bailey <derekbailey@google.com>
This will help the go cli and editors understand which directory is relevant to our go library.
Migration to go modules is recommended by the go team since version 1.16. See, https://github.com/golang/go/wiki/Modules
Note:
This change will also set the minimum version of go to be latest version (1.19) in order to use this library. That means clients using an older version of go will be required to upgrade their project.
We can reduce the minimum version to an older release if we see an issue with this.