fix: panic/race bug fixes, Go 1.26 upgrade, and README refresh#56
Merged
Conversation
- 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
64b4957 to
4ebbfd3
Compare
…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
4ebbfd3 to
086df52
Compare
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.
Summary
TCPProber.sendProbeがWaitGroupに参加しておらず、Stop()がin-flightなprobeより先にイベントチャネルをcloseしてpanicする恐れがあったmetricsManager.Registerがmutex未取得でmapを変更しておりレースの可能性HostListPanel.ScrollDownに上限チェックが無く、最終行選択時に次のrefreshで選択が先頭にリセットされる不具合map[string][]string]からmap[string]stringに変更し、READMEに書かれているスカラー構文(例:Authorization: Bearer token)が正しくパースされるように修正。あわせてconfig.LoadFileのエラーを握りつぶさないようにし、不正な設定ファイルでnilポインタpanicするのを防止demo/ディレクトリにVHSベースのデモ生成スクリプト(demo.tape)とデモgifを追加Test plan
go build ./cmd/mping/go vet ./...gofmt -l .(差分なし)go test ./...(全パッケージpass)golangci-lint run ./...(0 issues)