While you’re developing, I’d recommend just using replace
directives in your go.mod
to make any changes in dependencies instantly visible (regardless of version) to client code.
E.g. if you have package “client” using package “auth”:
$SOMEDIR/client/go.mod
would replace
dependency on client with $SOMEDIR/auth
, and now you can just develop the two alongside each other in $SOMEDIR
, commit changes to source control, etc.
When you’re ready to “ship” it, you’ll have to create an actual version for these modules. That is, if you even want auth
to be separately usable from client
. Consider keeping everything as private as possible (using internal
).
Read this official documentation on the subject for more details
solved How to develop golang modules efficiently [closed]