minimockbob is a sarcastic text generator written in Go that transforms strings into alternating capitalization
(e.g., "hello world" -> "hElLo WoRlD").
It can be imported as a Go package, compiled to a binary, or run as a container.
- Alternating Capitalization: The classic "mocking" text format.
- Multiple Interfaces: Use it as a CLI tool, a Go library, or a containerized service.
- Modern Tooling: Optimized for ko (containers) and melange (Wolfi APK packages).
- Minimal Footprint: Distroless-based container images (~10MB) and stripped binaries.
- Flexible Input: Supports CLI arguments, quoted strings, and piped input.
- Go 1.26+: Built using modern Go idioms and toolchain.
go run github.com/robotmaxtron/minimockbob/cmd/minimockbob@latest "mocking intensifies"
# mOcKiNg InTeNsIfIeSInstall with Go:
go install github.com/robotmaxtron/minimockbob/cmd/minimockbob@latestOr build from source:
git clone https://github.com/robotmaxtron/minimockbob.git
cd minimockbob/cmd/minimockbob
go buildBuild with ko:
# Set the target repository (use ko.local for local builds)
KO_DOCKER_REPO=ko.local ko build ./cmd/minimockbob
# Or build with OCI image labels and tags
KO_DOCKER_REPO=ko.local ko build \
--image-label org.opencontainers.image.source=https://github.com/robotmaxtron/minimockbob \
--image-label org.opencontainers.image.description="A sarcastic text generator" \
--image-label org.opencontainers.image.licenses=Apache-2.0 \
--tags latest,v0.0.1 \
./cmd/minimockbobBuild with melange:
# Generate a signing key (first time only)
melange keygen
# Build the package
melange build .melange.yaml \
--signing-key melange.rsa \
--runner docker \
--arch aarch64To install in a Wolfi container:
# Run Wolfi container with your packages directory mounted
docker run -v $(pwd)/packages:/packages --rm -it cgr.dev/chainguard/wolfi-base sh
# Inside the container, install the package
apk add --allow-untrusted /packages/aarch64/minimockbob-0.0.1-r0.apk
# Test the binary
minimockbob "Hello Wolfi"The binary supports three usage modes:
-
Quoted argument:
minimockbob "Hello, World!" # Output: hElLo, WoRlD!
-
Multiple unquoted arguments:
minimockbob Hello World # Output: hElLo WoRlD -
Pipe input:
echo "Hello, World!" | minimockbob # Output: hElLo, WoRlD!
Run the container built with ko:
# With arguments (use the image name from ko build output)
docker run --rm ko.local/minimockbob-<hash>:latest "Hello Container"
# With piped input
echo "Hello Container" | docker run --rm -i ko.local/minimockbob-<hash>:latestImport and use in your code:
package main
import (
"fmt"
"github.com/robotmaxtron/minimockbob"
)
func main() {
result := minimockbob.Gen("Hello, World!")
fmt.Println(result) // Output: hElLo, WoRlD!
}Run the full test suite:
go test ./...Run CLI functional tests:
cd cmd/minimockbob && go test -vRun tests with coverage:
go test -coverprofile=coverage.out -covermode=atomic ./...
go tool cover -func=coverage.outRun performance benchmarks:
go test -bench=. -benchmemTest the Wolfi APK package build and functionality:
# Run all melange tests (requires melange and Docker)
go test -v -run TestMelange
# Skip melange tests (faster local development)
go test -short ./...Note: If using Docker alternatives like colima, rancher-desktop, or podman, the melange build tests may fail due to Docker mount path issues. In this case, run melange directly as shown in the Installation section.
The project includes configuration for building optimized container images and packages:
.ko.yaml: Configuration for ko container builds..melange.yaml: Configuration for melange APK builds.
Both configurations focus on minimal attack surface (distroless), CGO disabled, and reproducible builds.
View the full package documentation:
# View package documentation locally
go doc -all github.com/robotmaxtron/minimockbob
# Or use godoc for a local server
# go install golang.org/x/tools/cmd/godoc@latest
godoc -http=:6060Online documentation is available at pkg.go.dev.
This package is a joke. Shoutout to mockbob. For my friend, James.
"Once men turned their thinking over to machines in the hope that this would set them free. But that only permitted other men with machines to enslave them."
— Reverend Mother Gaius Helen Mohiam, Dune by Frank Herbert
This project is licensed under the Apache License 2.0 – see the LICENCE file for details.