chore: gofmt the tree + add a CI gofmt gate
Summary
A small hygiene pass on the termshark fork. Unlike the other repos in this cleanup, the code and framing were already in good shape โ the fork is honestly attributed (README "Original Project" section credits Graham Clark, LICENSE preserved, fork note in go.mod), builds clean, go vet clean, all 27 test packages pass, and it works end to end (loads a pcap and parses packets via tshark 4.6.6). The only gap: gofmt.
Changes
- gofmt the tree: 54 hand-edited files had drifted (import ordering, struct-field alignment). Purely mechanical, no logic change.
- CI gofmt gate: the Go workflow ran build + vet + test but not a format check, so the drift went unnoticed. Add a
gofmt -lstep that fails on any unformatted file.
Verification
go build ./...,go vet ./...clean.go test ./...: all packages pass, 0 failures (before and after gofmt).- e2e: built
cmd/termshark, ran--pass-thru -r sample.pcap, confirmed real packets parsed via tshark 4.6.6.
Summary by Sourcery
Apply gofmt formatting across the Go codebase and introduce a CI gate to enforce gofmt cleanliness on tracked .go files.
Enhancements:
- Normalize struct field alignment, comments, and general formatting in Go source and test files to match gofmt output.
CI:
- Extend the Go GitHub Actions workflow with a gofmt-based format check that fails the build on any unformatted tracked .go file.
Summary by cubic
Standardized Go formatting across the repo and added a CI gofmt gate to keep it enforced. The gate skips files marked with the standard "Code generated ... DO NOT EDIT." header and fails on unformatted or parse-error files; no behavior changes.
- Refactors
- Ran
gofmtacross 54 files (import order/alignment only). - Added a
gofmtcheck to.github/workflows/go.ymlthat ignores generated files by marker. - Minor comment and whitespace cleanups (e.g.,
pkg/pcap/loader.go); build, vet, and tests remain green.
- Ran
Summary by CodeRabbit
- Bug Fixes
- Conversation views now retain the final conversation group when processing ends.
- Chores
- Added automated Go formatting checks to catch improperly formatted or invalid source files.
- Updated platform build metadata for more consistent cross-platform builds.
- Standardized formatting, import ordering, comments, and whitespace across the codebase.
- Tests
- Improved callback tracking in test utilities.
- Refreshed test formatting and fixtures without changing coverage or expected behavior.