Conversation
IceflowRE
marked this pull request as draft
July 27, 2026 22:17
Contributor
Author
|
Will fix race conditions later. |
IceflowRE
marked this pull request as ready for review
July 30, 2026 14:27
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.
if you do not want a thing to change, i can remove that commit.
Greptile Summary
This PR modernizes the codebase with idiomatic Go patterns across 58 files, targeting Go 1.26. It is a pure refactoring with no intended behavior changes.
fmt.Errorf("static string")replaced witherrors.New(...)throughout, and octal literals normalized to the0oprefix form.for i := range Ninteger ranges,strings.SplitSeq,slices.SortFunc,maps.Keys,sync.WaitGroup.Go, andnew(false)for pointer initialization.t.Parallel()added to nearly every test, global mutable state (SERVICESmap,http.DefaultTransport) replaced with per-instance state, and log-cleanup tests switched fromtime.Localtotime.UTCfor determinism.Confidence Score: 5/5
Safe to merge — all changes are refactoring with no logic regressions found.
Every functional change is a clean substitution of newer stdlib APIs for older ones (slices/maps/iter, errors.New, range-over-int, sync.WaitGroup.Go, strings.SplitSeq) with equivalent semantics. The removal of the global SERVICES map reduces shared mutable state, making tests and production code safer. The only substantive deviation is that the error message listing supported IP services is now non-deterministically ordered, which is cosmetic.
Files Needing Attention: provider/ip_service/ip_service.go — the slices.Collect(maps.Keys(...)) call in the error message produces a non-deterministic list of supported services.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[New IpService] --> B{len names == 0?} B -- yes --> C[error: no IP service names provided] B -- no --> D[build ipService with defaultServiceUrls] D --> E{each name in urls?} E -- no --> F[error: unsupported IP service maps.Keys order non-deterministic] E -- yes --> G[return ipService] H[getIP ctx client family] --> I{for each name} I --> J[lookup in ipService.urls] J --> K[HTTP request via resty client] K -- success --> L[return IP string] K -- failure --> M[append to failures try next name] M --> I I -- exhausted --> N[return joined errors]Reviews (4): Last reviewed commit: "refactor(logging): use time location fro..." | Re-trigger Greptile