- Test all:
go test ./... - Test single:
go test -run TestName -v - Lint:
golangci-lint run - Format:
gofmt -s -w .orgoimports -w . - Build:
go build ./... - Vet:
go vet ./...
- Package: Single package
ftpserverfor the entire library - Imports: Use
goimportswith local prefixgithub.com/fclairamb/ftpserverlib - Logging: Use
github.com/fclairamb/go-logwith aliaslog - Error handling: Use
errors.Is()for error checking, wrap with context - Naming: CamelCase for exported, camelCase for unexported
- Line length: Max 120 characters
- Function length: Max 80 lines, 40 statements
- Interfaces: Prefer small interfaces, use
afero.Fsas base - Constants: Group related constants with
iota - Types: Use type aliases for enums (e.g.,
HASHAlgo int8) - Testing: Use
testify/assertandtestify/requireand initialize instances with:req := require.New(t)