Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 2.9 KB

README.md

File metadata and controls

45 lines (29 loc) · 2.9 KB

go-module-template

go.dev reference Go Report Card codecov Go stability-frozen sourcegraph

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

First steps

  1. Replace LICENSE with your desired license. BSD 3 clause is included by default.

  2. Fix go.mod file by replacing github.com/YOURUSER/YOURREPONAME with your corresponding project repository link.

  3. Replace soypat/go-module-template in the badge URLs. Make sure you've replaced all of them by performing text search in the readme for soypat and template.

  4. Rename module.go and module_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.

Setting up codecov CI

This instructive will allow for tests to run on pull requests and pushes to your repository.

  1. Create an account on codecov.io

  2. Setup repository on codecov and obtain the CODECOV_TOKEN token, which is a string of base64 characters.

  3. Open up the github repository for this project and go to Settings -> Secrets and variables -> Actions. Once there create a New Repository Secret. Name it CODECOV_TOKEN and copy paste the token obtained in the previous step in the secret input box. Click "Add secret".