stringutils
A basic golang package for demonstration purpose. Package currently contains
only one function:
func Reverse(s string) (string, error)
Installation
Go to your project root, where go.mod
file exists, than grab the library via:
go get github.com/vigo/stringutils-demo@latest
Usage
package main
import (
"fmt"
"github.com/vigo/stringutils-demo"
)
func main(){
reversed, err := stringutils.Reverse("vigo")
if err != nil {
log.Fatal(err)
}
fmt.Println(reversed) // ogiv
}
Makefile
make help
Commands usage:
make <command>
commands:
test run tests
testfuzz run tests with fuzz (30 seconds)
bench run benchmark tests
doc run godoc server at 3000 unless PORT env-var is set
make test
: Runs tests
make testfuzz
: Runs Fuzzy tests for 30seconds (go 1.18
)
make bench
: Runs benchmark tests
make doc
: Runs godoc server on port 3000. Use PORT
environment variable
for different port -> PORT=4000 make doc
Contributor(s)
Contribute
All PR’s are welcome!
fork
(https://github.com/vigo/stringutils-demo/fork)
- Create your
branch
(git checkout -b my-feature
)
commit
yours (git commit -am 'add some functionality'
)
push
your branch
(git push origin my-feature
)
- Than create a new Pull Request!
License
This project is licensed under MIT
This project is intended to be a safe, welcoming space for collaboration, and
contributors are expected to adhere to the code of conduct.