On this page
Package format implements canonical TOML formatting for pgdesign schema files, reordering sections via a comment-preserving go-toml-edit AST in place.
#internal/format
#internal/format
Package format implements canonical TOML formatting for pgdesign schema files, reordering sections via a comment-preserving go-toml-edit AST in place.
It parses the input via go-toml-edit to get a comment-preserving AST, then reorders sections in-place according to canonical ordering. Comments attached to sections and keys travel with them during reordering.
#Config
type Config structConfig controls formatting behavior.
#DefaultConfig
func DefaultConfig() *ConfigDefaultConfig returns a Config with default values.
#Format
func Format(input []byte, config *Config) ([]byte, error)Format parses input TOML bytes and returns the canonically formatted output. Comments are preserved: leading comments and inline comments on sections and keys travel with their associated node during reordering.