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 ¶
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 ¶
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 ¶
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.