Help us shape the future of Go! Take the 2026 Go Developer Survey

pragma

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckMode added in v0.4.0

type CheckMode int
const (
	CheckAll CheckMode = iota
	CheckInclude
	CheckExclude
)

func (CheckMode) String added in v0.4.0

func (c CheckMode) String() string

type File

type File struct {
	Name          string
	Content       string
	CommentPrefix []string
	Pragmas       map[int]*Pragma

	CheckMode  CheckMode
	IssueCodes []string // issue codes to include / exclude based on the CheckMode.
}

func NewFile

func NewFile(name, content string, commentPrefix []string) *File

type Issue

type Issue struct {
	Column  int
	Message string

	// Hit is used internally by the diff tool to check for issues that were not hit.
	Hit bool
}

type Pragma

type Pragma struct {
	Issues map[string][]*Issue
	Hit    map[string]bool
}

Pragma is of the form [IssueCode]: Column "Message", Column "Message"; [AnotherIssueCode]: ...

func ParsePragma

func ParsePragma(comment string) *Pragma

ParsePragma expects a pragma comment (without the comment prefix like // or #) and returns a structured Pragma.

Jump to

Keyboard shortcuts

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