Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 2.18 KB

README.md

File metadata and controls

51 lines (39 loc) · 2.18 KB

Tag and release Go Report Card codecov

Random string generator

This CLI allows random string easyly from string set with given size.

Releases

To run this CLI go to releases and find the appropriate build from release page.

Usage

To run command first grab an executable from release.

~ rand-str --help # For help or rand-str -h
# Outputs
# usage: main <string_len> <string_set>

~ rand-str 6 # For random string of 6 characters
~ rand-str 9 "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" # For random string of 9 characters from "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" set

Test

To run tests locally make sure

  • Need Go 1.16
  • Setup project or clone outside GOPATH to check run go env GOPATH

To run test

go test -v -race ./...

To get test coverage

go test -v -race -coverprofile=/tmp/go-cover.`basename $(pwd)`.out -covermode=atomic ./... && go tool cover -func=/tmp/go-cover.`basename $(pwd)`.out && unlink /tmp/go-cover.`basename $(pwd)`.out

Or

go test -v -race -coverprofile=/tmp/go-cover.`basename $(pwd)`.out -covermode=atomic ./... && go tool cover -html=/tmp/go-cover.`basename $(pwd)`.out && unlink /tmp/go-cover.`basename $(pwd)`.out

Build

First clone the repo then follow the Tests step.

go build

Contributing

First clone the repo then follow the Tests step.

We use svu for automatic tagging and build of our repo using Github actions see svu commit message pattern for your commit message.