utils

package
v0.0.0-...-ae5582a Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoopLogger = log.New(bytes.NewBuffer([]byte{}), "", 0)

NoopLogger is a logger that won't log anything when called.s

Functions

func CheckPatterns

func CheckPatterns(patterns []string) error

CheckPatterns validates -exclude patterns.

func CheckRecursive

func CheckRecursive(path string) (adjustedPath string, recursive bool)

CheckRecursive checks if a provided path must be analyzed recursively. I.e. if it ends with the substring "...". If so, the first return value will be the path with "..." removed (else it will be exactly the provided input).

func IsPublicFunc

func IsPublicFunc(decl *ast.FuncDecl) bool

IsPublicFunc checks whether a function deceleration is for a public function.

func Min

func Min(v0 int, vs ...int) int

Min returns the minimum value out of n integers.

func PrintAll

func PrintAll(p Printer, issues []string)

PrintAll will print all messages using the provided Printer.

Types

type Printer

type Printer interface {
	Print(msgs ...interface{})
}

Printer is an interface for the Print function.

Jump to

Keyboard shortcuts

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