You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the go application contains only main package that directly reads command line args and outputs to stdout.
If one wants to re-use it in inside an own go build application its impossible to do
It would be nice to decompose to
pkg with the all the logic:
exported config structs
Build function that accepts the configs and optional logger and returns error
main package that
parses flags, converts them to config structs
calls Build from pkg connecting logger to stdout and prints an error if any
The resulting behavior will not change, but it will be possible to reuse pkg in other tools
I made the changes in a separate repo at the moment: https://github.com/cardinalby/xgo-as-library, but would like to create a PR to implement it inside your repo instead if you like the idea
The text was updated successfully, but these errors were encountered:
Hi and thx for the great tool!
Currently the go application contains only
main
package that directly reads command line args and outputs to stdout.If one wants to re-use it in inside an own go build application its impossible to do
It would be nice to decompose to
pkg
with the all the logic:Build
function that accepts the configs and optional logger and returnserror
main
package thatBuild
frompkg
connecting logger to stdout and prints an error if anyThe resulting behavior will not change, but it will be possible to reuse
pkg
in other toolsI made the changes in a separate repo at the moment: https://github.com/cardinalby/xgo-as-library, but would like to create a PR to implement it inside your repo instead if you like the idea
The text was updated successfully, but these errors were encountered: