← All languages

wildling

Go library and CLI for pattern-based string generation. Zero third-party modules (Go standard library only).

Example

Install

From this repository:

cd go
./build.sh
./bin/wildling "Year 19##"

Module (tags vX.Y.Z and go/vX.Y.Z on the monorepo — see docs/publishing.md):

go get github.com/dotmonk/wildling/go/v2@v2.0.0
go install github.com/dotmonk/wildling/go/v2/cmd/wildling@v2.0.0

As a library:

import "github.com/dotmonk/wildling/go/v2/wildling"

w := wildling.New([]string{"Year 19##"}, nil)
for {
    value, ok := w.Next()
    if !ok {
        break
    }
    fmt.Println(value)
}

CLI

./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json

Help text and --check output follow docs/cli.md / docs/help.txt.

Build

./build.sh   # Docker (golang:1.22): go build → dist/wildling

Project tests live in ../tests/ and are run with ../test.sh.