Skip to content

Latest commit

 

History

History
98 lines (73 loc) · 2.22 KB

CONTRIBUTING.md

File metadata and controls

98 lines (73 loc) · 2.22 KB

♥️ Welcome and thanks for contributing

First please read our code of conduct to proceed.


Setup | Linting/Testing | Writing Tests | Internals


Setup

We use go modules, so requirements for this project is go version >= 1.11.0.

And don't forget to enable GO111MODULE:

$ export GO111MODULE=on

Note: pre-requirements for linting is golang.org/x/lint/golint, so first install it:

$ go get -u golang.org/x/lint/golint

And then:

$ git clone https://github.com/olehan/kek
$ cd kek
$ make bootstrap

Linting/Testing

Lint your code by running:

$ make lint

And test it via:

$ make test

To lint and test:

$ make check

Writing Tests

Tests are written along with site the file it's testing.

For example, if your package request has a service.go in it tests would be written in service_test.go and so on.

Internals

  • Project Architecture - golang clean architecture | Struct:

    domain
    |   model.go
    |   repo.go
    └── service.go
    

    or

    domain
    |   {sub_domain}_model.go
    |   {sub_domain}_repo.go
    └── {sub_domain}_service.go
    
  • Commit messages convention - conventional commit messages | Examples:

  • Branch naming convention - type/title | Examples: feat/perform-request, ci/stale-bot, docs/contributing, fix/response-typo

  • Tar version names - semver | Examples: v1.2.3, v2.3.1-rc.3, v4.21.2-beta.4

  • Why space indention? - this answer from stackoverflow describes the idea.