Skip to content

Development

gsjonio edited this page Jul 13, 2026 · 3 revisions

🇧🇷 Português

Requires Go 1.24+.

git clone https://github.com/gsjonio/netwp.git
cd netwp
go build ./...
go test ./...
go vet ./...
gofmt -l .        # should print nothing

Checks that run in CI

Every push and PR runs, on Windows and Ubuntu:

  • go build, go vet, go test ./...
  • golangci-lint
  • go test -race ./... (Ubuntu, needs cgo, so it is not part of the local check on a machine without a C toolchain)
  • a short fuzzing pass over the DNS/mDNS/ARP wire parsers

-race needs a C toolchain (cgo), so it is not in the default local go test. The race and fuzz jobs cover the concurrent discovery paths and the parsers of untrusted network input.

Where things go

netwp is hexagonal (see Architecture). The rule of thumb when adding a capability:

  • Domain logic (a new use case, a type, a heuristic) goes in internal/core, behind a port interface. core never imports net, os/exec, or syscall.
  • Anything that talks to the OS or network goes in internal/adapter/*, implementing a core port. Platform-specific code is split by build tags (_windows.go, _linux.go, _other.go).
  • CLI wiring stays thin, in cmd/netwp.
  • Terminal rendering goes in internal/tui.

Non-trivial logic (a branch, a parser, a heuristic) ships with a test. The parsers that read network bytes also have fuzz targets.

Docs to keep in sync

The README and README.pt-BR are bilingual and must stay structurally identical. If a change is something a beginner needs explained, update the guide pair too.

Full contributor guide, commit-message conventions, and PR checklist: CONTRIBUTING.md. This project follows the Code of Conduct.

Clone this wiki locally