format

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 7 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// SearchDir the swag would be parse
	SearchDir string

	// excludes dirs and files in SearchDir,comma separated
	Excludes string

	// MainFile (DEPRECATED)
	MainFile string
}

Config specifies configuration for a format run

type Format

type Format struct {
	// contains filtered or unexported fields
}

Format implements `fmt` command for formatting swag comments in Go source files.

func New

func New() *Format

New creates a new Format instance

func (*Format) Build

func (f *Format) Build(config *Config) error

Build runs formatter according to configuration in config

func (*Format) Run

func (f *Format) Run(src io.Reader, dst io.Writer) error

Run the format on src and write the result to dst.

Jump to

Keyboard shortcuts

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