Split repository into library part and cmd
part
#2
Labels
No Label
bug
feature
good-beginner-bug
needs-test
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: electricdusk/rushlink#2
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Typically, the
main
package (which becomes an executable) is situated incmd/<executable name>
:cmd/rushlink/
.Ack. Do I also move all the other files there, or just the entrypoint (i.e.
rushlink.go
)?Thanks for splitting the repository, but I'm reopening this because it seems you've moved more than really needed.
For example, there are exported structs and methods in
internal/handlers/handlers.go
. It is better to keep exported stuff out of a tree that starts withinternal
.Suppose I want to write a Go program that interfaces with
rushlink
. I'm not interested in the binary (that's why themain
package is now neatly defined incmd/rushlink/
), but I do want access to, for example,StoredPaste
. It's counterintuitive (non-idiomatic) to import packages that haveinternal
in their path, when the importing package is not part ofrushlink
.Another thing
pkg/gobmarsh
has apkg/
too many. See https://golang.org/doc/effective_go.html#package-names for some hints on package names; brevity is one of them.