▲ | everybodyknows 4 days ago | |||||||||||||||||||||||||
> We named the package hello_test instead of hello. This is possible and it allows for writing tests that use only the public API (identifiers starting with a capital letter) of the tested package as a real user would. Would be good to highlight here that *_test packages are the sole exception from Go's standard rule of one-package-only per source directory -- special cases being always an unfortunate additional heightening of the beginner's learning curve. | ||||||||||||||||||||||||||
▲ | reisinge 4 days ago | parent | next [-] | |||||||||||||||||||||||||
Thanks, done: https://github.com/go-monk/from-bash-to-go-part-ii/commit/16... | ||||||||||||||||||||||||||
▲ | ttz 4 days ago | parent | prev [-] | |||||||||||||||||||||||||
You can also include package main files in a non-main package directory (usually sed when implementing go generate) | ||||||||||||||||||||||||||
|