Skip to content

fix: resolve all go-review issues (CRITICAL/HIGH/MEDIUM)#21

Merged
nagayon-935 merged 1 commit into
mainfrom
fix/go-review-issues
Apr 17, 2026
Merged

fix: resolve all go-review issues (CRITICAL/HIGH/MEDIUM)#21
nagayon-935 merged 1 commit into
mainfrom
fix/go-review-issues

Conversation

@nagayon-935

Copy link
Copy Markdown
Owner

CRITICAL:

  • portchecker: handle SetDeadline/Write errors in checkUDP to prevent goroutine leak
  • traceroute: check SetControlMessage error on IPv6 send socket (non-fatal)

HIGH:

  • mping: protect portChecker with pMu mutex to eliminate data race across goroutines
  • mping: create real doneCh when cfg.count > 0 so TUI shows "Finished" footer
  • mping: use errors.Is for pflag.ErrHelp comparison
  • ui: replace 16-parameter Run() with RunOptions struct
  • mping/traceroute: wrap errors with context in socket open paths and getInterfaceIP

MEDIUM:

  • pinger: replace raw sync/atomic usage with atomic.Uint32 for traceCounter
  • pinger/portchecker: use errors.As instead of direct type assertions for net.Error
  • tui_helpers: return false (not silent zero) on ParseFloat error in filter
  • tui_helpers: appendErrorLog uses incremental fmt.Fprintf (O(1)) instead of O(n) join on every call
  • pinger: add godoc to NewPinger, NewPingerWithOptions, Reply

CRITICAL:
- portchecker: handle SetDeadline/Write errors in checkUDP to prevent goroutine leak
- traceroute: check SetControlMessage error on IPv6 send socket (non-fatal)

HIGH:
- mping: protect portChecker with pMu mutex to eliminate data race across goroutines
- mping: create real doneCh when cfg.count > 0 so TUI shows "Finished" footer
- mping: use errors.Is for pflag.ErrHelp comparison
- ui: replace 16-parameter Run() with RunOptions struct
- mping/traceroute: wrap errors with context in socket open paths and getInterfaceIP

MEDIUM:
- pinger: replace raw sync/atomic usage with atomic.Uint32 for traceCounter
- pinger/portchecker: use errors.As instead of direct type assertions for net.Error
- tui_helpers: return false (not silent zero) on ParseFloat error in filter
- tui_helpers: appendErrorLog uses incremental fmt.Fprintf (O(1)) instead of O(n) join on every call
- pinger: add godoc to NewPinger, NewPingerWithOptions, Reply
@nagayon-935 nagayon-935 merged commit 3a55bdb into main Apr 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant