gensource

package
v0.5.34 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package gensource identifies the Go files a generation run wrote.

Index

Constants

View Source
const DefaultPrefix = "Code generated by tinybind"

DefaultPrefix is what every generated file of this module leads with. The suffix varies by artifact ("by tinybind", "by tinybind templates"), so the prefix is what identifies the writer.

Variables

This section is empty.

Functions

func IsGenerated

func IsGenerated(file *ast.File, extra ...string) bool

IsGenerated reports whether file carries a generated header this run owns.

Discovery skips such a file. A generated registry registers the pages of a route tree, so reading it back would discover those pages as routes and put an HTML page and its action endpoints into an OpenAPI document, which is exactly what a page route is not. The same applies to a generated binder or component: nothing the run wrote is an input to what it reads.

extra names further header prefixes, which is how a framework generating with this module declares its own output. A framework that brands its generated files writes a header this package cannot recognize on its own, and an unrecognized generated registry is discovered like hand-written code. Each entry is matched as a prefix of the comment text and still requires the conventional "DO NOT EDIT." ending.

Another tool's generated code is deliberately not skipped by default. Its registrations are a user's own API surface, and dropping them would remove routes from a document with nothing said about it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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