rules

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Overview

Package rules holds the formatting rules an enable module registers.

A rule set that would cost a dependency does not ship with github.com/go-openapi/codegen/formatting. It lives in a module of its own under formatting/enable, which registers it here from an init, so a build that does not import that module does not require what it requires.

The package is internal because registering is not something a caller does: a caller states the intent with a blank import, and the enable module calls Register.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(rules Func)

Register makes a rule set available. Registering twice replaces the previous set, and registering nil removes it.

Types

type Func

type Func func(*token.FileSet, *ast.File)

Func applies a set of formatting rules to a parsed file, in place.

func Registered

func Registered() Func

Registered returns the rule set, or nil when no enable module was imported.

Jump to

Keyboard shortcuts

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