3 Commits

Author SHA1 Message Date
86ffa2fb23
chore: remove IPv6 special-casing (YAGNI)
Drop the explicit IPv6 early-exit in ReadAll — ParseIPv4 already rejects
non-IPv4 via Is4(). Remove IPv6-specific tests and error message wording.
2026-04-20 09:54:04 -06:00
896031b6a8
fix: idiomatic Go cleanup across net packages
- gitshallow: replace in-place Depth mutation with effectiveDepth() method;
  remove depth normalisation from New() since it was masking the bug
- ipcohort: extract sortNets() helper using cmp.Compare, eliminating 3 identical
  sort closures; add ContainsAddr(netip.Addr) for pre-parsed callers; guard
  Contains() against IPv6 panic (As4 panics on non-v4); add IPv6 test
- dataset: Add() now sets NopSyncer{} so callers cannot panic by accidentally
  calling Init/Sync/Run on a Group-managed Dataset
2026-04-20 09:47:50 -06:00
410b52f72c
test: ipcohort + dataset; fix ParseIPv4 panic on IPv6
- ParseIPv4 now returns an error instead of panicking on IPv6 addrs
- Add ipcohort tests: ParseIPv4, Contains (host/CIDR/mixed/fail-closed/empty), Size, LoadFile, LoadFiles, IPv6 skip
- Add dataset tests: Init, Sync (updated/no-update), error paths, Close hook, Run tick, Group (single fetch drives all loaders)
2026-04-20 09:36:13 -06:00