sgreben / tj

stdin line timestamps. single binary, no dependencies. osx & linux & windows. plays well with jq.
230 stars 2 forks source link

Comments #1

Open sgreben opened 6 years ago

divan commented 6 years ago

Nice tool!

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.

sgreben commented 6 years ago

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 :)