Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR exposes the previously private insertJSON method as a public InsertJSON function and updates its call site to supply a full file path.
- Renamed
insertJSON(method onWriter) toInsertJSON(top-level function) and removed its receiver - Updated the call site in
WriteGeoIP2TestDBto useInsertJSONwithfilepath.Join(w.source, …) - Adjusted function signature and doc comment to match the exported name
Comments suppressed due to low confidence (2)
pkg/writer/geoip2.go:89
- [nitpick] The parameter name
jsonFilePathis a bit verbose; consider renaming it tofilePathfor conciseness since the function already indicates JSON context.
func InsertJSON(dbWriter *mmdbwriter.Tree, jsonFilePath string) error {
pkg/writer/geoip2.go:74
- [nitpick] Exporting InsertJSON makes it part of the public API. Verify that this export is intended for external consumption; if not, consider keeping it unexported.
if err := InsertJSON(dbWriter, filepath.Join(w.source, jsonFileName)); err != nil {
Comment on lines
+87
to
88
| // InsertJSON reads and parses a json file into mmdbtypes values and inserts | ||
| // them into the mmdbwriter tree. |
There was a problem hiding this comment.
[nitpick] The doc comment for InsertJSON is split across two lines. Combine into one sentence that starts with the function name and ends with a period, e.g., // InsertJSON reads and parses a JSON file into mmdbtypes values and inserts them into the mmdbwriter tree.
Suggested change
| // InsertJSON reads and parses a json file into mmdbtypes values and inserts | |
| // them into the mmdbwriter tree. | |
| // InsertJSON reads and parses a JSON file into mmdbtypes values and inserts them into the mmdbwriter tree. |
c69e7c5 to
9b9c5b7
Compare
blakeyjason
approved these changes
May 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.