The template-go repository serves as a starting point for new repositories hosting Go code.
It also shows best practices that can be retro-fitted into existing repositories hosting Go code.
Overview
Aspects of the template-go repository:
Badges: Example badges can be seen above.
Makefile: Simplifies development lifecycle commands.
Sample code:main.go and examplepackage code examples.
Sample test cases:*_test.go files showing how to write and document test cases.
Sample documentation: Documentation style conducive to the Go Package library.
Dockerfile: Containerizing the Go program.
RPM/DEB builds: Using package.Dockerfile to build RPM and DEB files for installation.
.github/workflows: GitActions tailored to Go programming.
.github/dependabot.yml Specifications for keeping Go dependencies up-to-date.
Senzing documentation will be in the "Third party" section.
github.com > senzing > template-go
When a versioned release is published with a v0.0.0 format tag,
the reference can be found by clicking on the following badge at the top of the README.md page:
Docker
Use make target to run a docker images that builds RPM and DEB files.
Example:
cd ${GIT_REPOSITORY_DIR}
make docker-build
Run docker container.
Example:
docker run \
--rm \
senzing/template-go
Package
Package RPM and DEB files
Use make target to run a docker images that builds RPM and DEB files.
Example:
cd ${GIT_REPOSITORY_DIR}
make package
The results will be in the ${GIT_REPOSITORY_DIR}/target directory.
Example:
tree ${GIT_REPOSITORY_DIR}/target
Test DEB package on Ubuntu
Determine if template-go is installed.
Example:
apt list --installed | grep template-go
✏ Install template-go.
Example:
cd ${GIT_REPOSITORY_DIR}/target
sudo apt install ./template-go-0.0.0.deb