!The API is incompatible with dustinkirkland/golang-petname!
The goal is to provide a low overhead alternative that'S well-maintained and simple to work with.
Add to your dependencies:
go get github.com/Bios-Marcel/go-petname
Call the Generate
function:
// Results in word_word_word
petname.Generate(3, petname.Lower, petname.Underscore)
You can change the wordlists by calling SetNames
, SetAdjectives
and
SetAdverbs
. Note that by default, the short
package is used as the source of
words for all groups. The other packages available are medium
and long
.
Technically you can provide your own lists.
The wordlists are generated like this:
go run ./cmd/generate folder > target/words.go
Replace folder
with the folder that contains adjectives.txt
, adverbs.txt
and names.txt
.