The second thing I'd like to do is make gopar suitable for use as a library. By that I don't mean all the primitives it contains, but (also?) the interface through main(). The fastest way to to it would be to turn main() into par(args []string), and have main() call it. However I'm certain you would prefer a break up into separate create(), verify() and repair() functions :) In which case, the flagsetting part of main needs to be duplicated. Copy paste or is there a cleaner way? With my C++/Python hat on, I think of hiding all that in a class, but that doesn't seem to be the Go way so I ask.
- What form would you prefer? Maybe another?
- Where in the file hierarchy would you put the lib, meant for external use? Is there a convention like
/cmd? Maybe just the root?
The second thing I'd like to do is make gopar suitable for use as a library. By that I don't mean all the primitives it contains, but (also?) the interface through
main(). The fastest way to to it would be to turnmain()intopar(args []string), and havemain()call it. However I'm certain you would prefer a break up into separatecreate(),verify()andrepair()functions :) In which case, the flagsetting part of main needs to be duplicated. Copy paste or is there a cleaner way? With my C++/Python hat on, I think of hiding all that in a class, but that doesn't seem to be the Go way so I ask./cmd? Maybe just the root?