Foundational elements for creating new "library" packages.
N.B.: The commands in this section assume you have set the
REPO_NAME
variable e.g.:REPO_NAME=mypkg
To make use of this template, you will need to create a new repository and pass this repository as the template argument. To do this with the GitHub CLI you can run something like:
gh repo create $REPO_NAME --template https://github.com/haleyrc/lib-template --public
You can now pull down the repository to your local machine using:
git clone git@github.com:haleyrc/$REPO_NAME.git
Now you'll want to do some housekeeping so run:
cd $REPO_NAME
followed by:
go mod init github.com/haleyrc/$REPO_NAME
Next, you'll want to modify the repository README to match your package name, description, etc.
Note that you should be modifying the README.md
file at the root of the repository and not this file.
Once that's done, you can delete this file which will make the repository README the default.
Finally, you can add everything to Git and amend the default initial commit created by the template:
git add .
git commit --amend -m "chore: Initial commit"
git push -f