I would comment on the package layout, as it looks overcomplicated as for the single binary Go tool. Moving main.go into cmd/ makes sense if there is more than one binary in the repo. Otherwise having main.go in root makes more sense. It also simplifies getting package:
go get -u github.com/sgreben/tjj instead of go get -u github.com/sgreben/tj/cmd/tj
The same goes with pkg/color — no need to create a separate subpackage just for one color abstraction. Simple color.go in the same package would do the job. Namespacing this package with pkg directory also begs for simplification. So I would just move color.go into the root.
Thanks for the comments! I anticipate more things to be factored out into pkg/, so I'd prefer to keep this structure, even if it is overkill at first :)
Nice tool!
I would comment on the package layout, as it looks overcomplicated as for the single binary Go tool. Moving
main.go
intocmd/
makes sense if there is more than one binary in the repo. Otherwise havingmain.go
in root makes more sense. It also simplifies getting package:go get -u github.com/sgreben/tjj
instead ofgo get -u github.com/sgreben/tj/cmd/tj
The same goes with
pkg/color
— no need to create a separate subpackage just for one color abstraction. Simplecolor.go
in the same package would do the job. Namespacing this package withpkg
directory also begs for simplification. So I would just movecolor.go
into the root.