-
Notifications
You must be signed in to change notification settings - Fork 66
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
generate test mmdb files with go mmdbwriter. #122
Conversation
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I had two tiny comments.
pkg/writer/geoip2.go
Outdated
"static_ip_score": | ||
return mmdbtype.Float64(v), nil | ||
default: | ||
return mmdbtype.Float64(v), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to return an error here? I think we would want to force people to think about what they should do with an unknown numeric type generally as most of the time it shouldn't be a double.
pkg/writer/decoder.go
Outdated
"en": "MaxMind DB Decoder Test database - contains every MaxMind DB data type", | ||
}, | ||
DisableIPv4Aliasing: false, | ||
DisableMetadataPointers: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could drop this for all the writers. The reason is that we want people to support metadata pointers in their reader implementation. The databases we generate internally sometimes enable this as some readers did not in the past.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's what I originally did, but I changed my mind when I found out that there's a test db specific for metadata pointers, and thought that having a differentiator might be beneficial. But it doesn't really help now that I think more about it!
This PR includes the new go tool and includes the regenerates the test files.