member-lib
is a Go library by Coop Norge designed to provide reusable
packages for various use cases within the Member domain.
It aims to enhance productivity and provide generalized, abstract solutions applicable across a variety of use cases.
To install the library, use:
go get github.com/coopnorge/member-lib/pkg/{package_of_interest}
Import the desired package in your Go project:
import "github.com/coopnorge/member-lib/pkg/<package_name>"
package main
import (
"fmt"
"github.com/coopnorge/member-lib/pkg/package1"
)
func main() {
result := package1.Function()
fmt.Println(result)
}
We welcome contributions!
For code style we have own preferences but not so different for standard Go style. However, good to keep in mind:
- Abstract and not contain domain related names.
- Components must be covered with tests.
- Code style go standards with some Coop preferences. if you are internally contributor, please visit: Coop Golan Guidelines
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Push your changes and create a pull request.
To verify if technical documentation is built properly run:
docker compose up techdocs
Components must be:
For validating and building Golang code you can use Coops docker tool.
Build images:
docker compose build
See available targets:
docker compose run --rm golang-devtools help
Validate golang:
docker compose run --rm golang-devtools validate VERBOSE=all
Test golang code:
docker compose run --rm golang-devtools test VERBOSE=all