Skip to content

refactor: split spfd command handling - #54

Merged
zaccone merged 1 commit into
masterfrom
refactor-spfd-main
Sep 15, 2026
Merged

zaccone merged 1 commit into
masterfrom
refactor-spfd-main

Conversation

@zaccone

@zaccone zaccone commented Sep 15, 2026

Copy link
Copy Markdown
Owner

What changed

  • move one-off SPF checking into check.go
  • move policy service startup and listener setup into serve.go
  • centralize shared DNS, timeout, and receiver flags in options.go
  • keep main.go focused on signal handling and command dispatch

Why

cmd/spfd/main.go mixed command parsing, SPF evaluation, resolver setup, and service startup in one large function. Splitting these responsibilities makes the entry point easier to scan and each command easier to maintain.

Validation

  • go test -race -count=1 -timeout=60s ./...
  • go vet ./...
  • service smoke test covering check and serve modes
  • before/after comparison of 26 CLI cases for identical output and exit status

Risk

Low. This is a structural refactor with unchanged flags, defaults, validation, output, and runtime behavior.

@zaccone
zaccone merged commit 4b2195e into master Sep 15, 2026
5 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