Go module template with instructions on how to make your code importable and setting up codecov CI.
How to install package with newer versions of Go (+1.16):
go mod download github.com/soypat/go-module-template@latest
-
Replace LICENSE with your desired license. BSD 3 clause is included by default.
-
Fix
go.mod
file by replacinggithub.com/YOURUSER/YOURREPONAME
with your corresponding project repository link. -
Replace
soypat/go-module-template
in the badge URLs. Make sure you've replaced all of them by performing text search in the readme forsoypat
andtemplate
. -
Rename
module.go
andmodule_test.go
to fit your own repository needs. Below are some exemplary modules that abide by what's generally considered "good practices":mu8
minimal machine learning library. Note how most interfaces and interface algorithms are defined at the root package level and how the concrete implementations live in the subdirectories.- Similarily
sdf
also does the same with defining interfaces top level.
This instructive will allow for tests to run on pull requests and pushes to your repository.
-
Create an account on codecov.io
-
Setup repository on codecov and obtain the CODECOV_TOKEN token, which is a string of base64 characters.
-
Open up the github repository for this project and go to
Settings -> Secrets and variables -> Actions
. Once there create a New Repository Secret. Name itCODECOV_TOKEN
and copy paste the token obtained in the previous step in thesecret
input box. Click "Add secret".