This kata deals with use of standard tooling and project structure The intent is less on the algorithm, but to show various stages of the pipeline process. From formatting, linting, building a docker image, to running unit tests to verify the library is working ok.
Also dealing with some proper input strings naughtiness.
The code was written following: https://github.com/uber-go/guide/blob/master/style.md. Note some of the test cases were taken from: https://github.com/minimaxir/big-list-of-naughty-strings/blob/master/blns.txt.
This app assumes you are running it under a LINUX-like system. We are assuming basic golang infra, makefile and docker were already installed.
First thing to do is to modify your ~/.bashprofile to include:
export GOPATH=$HOME/go
export GOBIN=$HOME/go/bin
export PATH=$PATH:$HOME/go/binThis is to ensure you have the right go env variables set.
Please execute after editing:
source ~/.bash_profileAfterwards please ensure you have installed:
- golang linter
go get -u golang.org/x/lint/golint- golang test library (testify)
go get github.com/stretchr/testifyBy command line:
make allYou can review the specific commands in Makefile file.
See LICENSE file.