Skip to content

fix: panic/race bug fixes, Go 1.26 upgrade, and README refresh#56

Merged
servak merged 5 commits into
mainfrom
fix/bug-and-versionup
Jul 5, 2026
Merged

fix: panic/race bug fixes, Go 1.26 upgrade, and README refresh#56
servak merged 5 commits into
mainfrom
fix/bug-and-versionup

Conversation

@servak

@servak servak commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Go 1.26 へアップグレードし、tcell/cobra/go-pretty/miekg-dns などの依存パッケージを更新(CI/releaseワークフローも追従)
  • staticcheck指摘(golangci-lint)を解消
  • シャットダウン時のパニック・データレース・選択位置リセットの3件を修正
    • TCPProber.sendProbeがWaitGroupに参加しておらず、Stop()がin-flightなprobeより先にイベントチャネルをcloseしてpanicする恐れがあった
    • metricsManager.Registerがmutex未取得でmapを変更しておりレースの可能性
    • HostListPanel.ScrollDownに上限チェックが無く、最終行選択時に次のrefreshで選択が先頭にリセットされる不具合
  • HTTPヘッダー設定のconfig型をmap[string][]string]からmap[string]stringに変更し、READMEに書かれているスカラー構文(例: Authorization: Bearer token)が正しくパースされるように修正。あわせてconfig.LoadFileのエラーを握りつぶさないようにし、不正な設定ファイルでnilポインタpanicするのを防止
  • READMEの説明文をnetwork operator向けに書き直し、demo/ディレクトリにVHSベースのデモ生成スクリプト(demo.tape)とデモgifを追加

Test plan

  • go build ./cmd/mping/
  • go vet ./...
  • gofmt -l .(差分なし)
  • go test ./...(全パッケージpass)
  • golangci-lint run ./...(0 issues)
  • mping/batch/config各コマンドで実機動作確認

servak added 4 commits July 4, 2026 14:17
- Bump go.mod Go version directive from 1.24 to 1.26
- Update tcell/v2 v2.8.1 -> v2.13.10
- Update jedib0t/go-pretty/v6 v6.4.6 -> v6.8.2
- Update miekg/dns v1.1.66 -> v1.1.72
- Update rivo/tview to release v0.42.0 (was a pseudo-version)
- Update spf13/cobra v1.7.0 -> v1.10.2
- Update golang.org/x/net v0.41.0 -> v0.56.0 and other x/* packages
- Update CI/release workflows to use Go 1.26
- Verified build, tests, and go vet all pass
- Replace deprecated cmd.SetOutput with SetOut/SetErr in main.go
- Replace WriteString(fmt.Sprintf(...)) with fmt.Fprintf(...) (QF1012)
  in icmp.go and ui/shared/formatters.go

golangci-lint run ./... now reports 0 issues.
- Fix TCPProber.sendProbe not joining the WaitGroup, which let
  Stop() close the event channel before in-flight probes finished,
  risking a panic from sending on a closed channel
- Fix metricsManager.Register mutating the metrics map without
  holding the mutex, racing with concurrent event processing
- Fix HostListPanel.ScrollDown missing an upper bound check, which
  invalidated the selection at the last row and reset it to the
  first row on the next refresh
- Change HTTPConfig.Header from http.Header (map[string][]string) to
  map[string]string so the README-documented scalar syntax
  (e.g. "Authorization: Bearer token") unmarshals correctly instead
  of failing with a YAML type error
- Use req.Header.Set() in customTransport.RoundTrip instead of raw
  map assignment, which also canonicalizes header keys
- Stop discarding the error from config.LoadFile in the mping,
  batch, and config print commands; a malformed config file (like
  the header YAML above) returned a nil *Config, and the following
  cfg.SetTitle()/config.Marshal() call panicked on nil dereference
@servak servak force-pushed the fix/bug-and-versionup branch from 64b4957 to 4ebbfd3 Compare July 5, 2026 09:29
…h VHS

- Rewrite intro and Features to appeal to network operators, emphasizing subnet-wide monitoring and multi-protocol support
- Consolidate demo.tape/gif under demo/ directory for easier regeneration with vhs
- Add a CIDR subnet expansion demo to showcase mping's key feature at a glance
@servak servak force-pushed the fix/bug-and-versionup branch from 4ebbfd3 to 086df52 Compare July 5, 2026 09:32
@servak servak merged commit 18f3d58 into main Jul 5, 2026
5 checks passed
@servak servak deleted the fix/bug-and-versionup branch July 5, 2026 09:35
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