Skip to content

facily-tech/go-core

Repository files navigation

go-core

Creating new modules

  1. Create a folder on root directory of this repository with the name of your new module
  2. Enter the newly created directory and execute:
$ go mod init github.com/facily-tech/go-core/MODULE-NAME
  1. Put your module code inside the subdirectory you just created
  2. Create a README.md describing how to use the module

Tags should be created only in the main branch!

$ git tag -a MODULE-NAME/v0.1.0
$ git push --tags

How to import modules

go get github.com/facily-tech/go-core/MODULE-NAME

Lint

Crate a link to .golanci.yml from project root folder to our subproject. Something like this:

cd MY_REPO_ROCKS
ln -s ../.golangci.yml .

Lint troubleshooting

  • File is not gci-ed (gci): install gci and run: gci -w FILE_WITH_PROBLEM
  • File is not gofumpt-ed (gofumpt): install gofumpt and run : gofumpt -w FILE_WITH_PROBLEM
  • Return with no blank line before (nlreturn): insert "enter" before "return"
  • Error returned from external package is unwrapped see this: