An initial template repository for a Go project
- Install the
golang
compiler from the official source (version 1.21.3) - Include $GOPATH in your path via
export PATH=$PATH:$(go env GOPATH)/bin
- Adding the above to your
~/.bashrc
file will requiresource ~/.bashrc
go run main.go
- Language: [email protected]
- Package Management Tool: go mod
- Code Format Tool: [email protected]
- Static Analysis Tool: [email protected]
- CI Tool: [email protected]
$ tree
.
|____go.mod # dependencies
|____LICENSE
|____Makefile # make test, fmt….
|____README.md
|____.gitignore
|____.circleci # CI configuration
|____main.go # main function
|____pkg # Components
|____.golangci.yml # golangci-lint Configuration
Calculator Component is the Interface exposed to the user.
- It gives the user an encapsulated calculator object which receives operands.
Operator Component is the internal library for the Calculator.
- It gives the calculator some operator objects which implements the real calculations.
Please edit it for your projects.
- Install dependency and tools (golangci-lint)
- Run unit tests
- Code static analysis and format check
You have to prepare tools with make.
make tools
Also, you can run lint, format and test with make before making a pull request.
# test
make test
# lint
make lint
# format
make format