generator

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package generator scaffolds new terminull projects: a go.mod, a main package wiring the framework, sample commands using logger/tables, and a README. Generated Go files pass through go/format, so a template bug fails generation instead of shipping broken code.

Index

Constants

View Source
const DefaultTerminullVersion = "v1.0.0"

DefaultTerminullVersion pins new projects to the latest released framework. Override per project with Options.TerminullVersion.

Variables

This section is empty.

Functions

func Generate

func Generate(opts Options) ([]string, error)

Generate writes the scaffold into Dir and returns created file paths. An existing Dir must be empty; generated Go files are gofmt-formatted.

func ValidateName

func ValidateName(name string) error

ValidateName rejects empty names, path characters, and Windows-reserved device names before any prompting or file work happens.

Types

type Options

type Options struct {
	// Name is the binary, directory, and app name, e.g. "hello".
	Name string
	// Module is the go.mod module path, e.g. "example.com/hello".
	Module string
	// Dir is the target directory, created when missing.
	Dir string
	// TerminullVersion is the framework require version, e.g. "v1.0.0".
	TerminullVersion string
	// Replace adds a replace directive (local dogfood), slashes normalized.
	Replace string
}

Options tunes a Generate call. Name is required; Module defaults to Name (a relative module path builds fine locally); Dir defaults to ./Name; TerminullVersion defaults to DefaultTerminullVersion.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL