Restructure the Golang client project repo
VojtechVitek opened this issue · 4 comments
VojtechVitek commented
In golang, we usually put the client pkg into the top-level directory (unless the project is too big and has multiple clients, of course). Imho you can get rid of the lib/
subdirectory :)
If you wanted to implement CLI (a terminal program that downloads screenshots from a remote server), it'd live in /cmd/screenshot/main.go
.
When the client pkg is in the top-level directory, the imports are as easy as
import (
"github.com/pressly/screenshot"
)
func main() {
screenshot, _ := screenshot.New(...)
// ...
}
VojtechVitek commented
In other words..
move screenshot/main.go
to cmd/screenshot/main.go
. Move lib/
into the top level directory.
VojtechVitek commented
Also, try to split PNG, PDF and JPEG into separate files (ie. client.go
, png.go
etc.).
marcellerusu commented
@VojtechVitek I will close this when you approve of the restructure
VojtechVitek commented
LTGM! Well done