format

package
v1.16.5 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 7 Imported by: 0

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