swaggoswag

package module
v0.0.0-...-77f2aca Latest Latest
Warning

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

Go to latest
Published: May 4, 2025 License: MIT Imports: 10 Imported by: 1

README

Fork of swaggo/swag

This is a hard fork of swaggo/swag to be usable as a library.

I considered other options before deciding to fork, but there are no straightforward or non-invasive changes.

Issues should be open either on the original swaggo/swag repository or on golangci-lint repository.

No modifications will be accepted other than the synchronization of the fork.

The synchronization of the fork will be done by the golangci-lint maintainers only.

Modifications

  • All the files have been removed except:
    • formatter.go (the unused field debug Debugger is removed)
    • formatter_test.go
    • parser.go (only the constants are kept.)
    • license
    • .gitignore
  • The module name has been changed to github.com/golangci/swaggoswag to avoid replacement directives inside golangci-lint.
    • The package name has been changed from swag to swaggoswag.

History

  • sync with 93e86851e9f22f1f2db57812cf71fc004c02159c (after v1.16.4)

Documentation

Index

Constants

View Source
const (
	// CamelCase indicates using CamelCase strategy for struct field.
	CamelCase = "camelcase"

	// PascalCase indicates using PascalCase strategy for struct field.
	PascalCase = "pascalcase"

	// SnakeCase indicates using SnakeCase strategy for struct field.
	SnakeCase = "snakecase"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter struct{}

Formatter implements a formatter for Go source files.

func NewFormatter

func NewFormatter() *Formatter

NewFormatter create a new formatter instance.

func (*Formatter) Format

func (f *Formatter) Format(fileName string, contents []byte) ([]byte, error)

Format formats swag comments in contents. It uses fileName to report errors that happen during parsing of contents.

Jump to

Keyboard shortcuts

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