Highlights of a command-line app development journey, a work in progress.
- What the app does
- read a config
- replace values
- call http endpoint
- output results
- fork of
pflags
to capture unknown values - Concepts and features
- Sources - args, env, func-files (TBD), std in (TBD), data files (TBD)
- Config readers - json, postman, curl files (TBD), bash history (TBD)
- Functions with no side effects, only
main
- references
os.Stdout
- references
os.Stdin
- calls
os.Exit
(preventsdefer
s running)
- references
- started with functions as the dependency contract, only moved to
interface
when required - tab complete
- separate package
- mock object with tests
- debug cli tool to generate inputs for debugging
- hook for debugging asa package, packages should not log
- BDD named tests
- avoid table tests except where they really help
- hierarchy of tests to prepare scenarios
- Random stuff
- config loader does not allow file read errors to escape. I think a diagnostics hook might be needed
- So far I've not got the circle ci test output to display
- needs field testing
END