Back to / internal / format

Package format

Latest Go to latest
Published: Nov 11, 2018 | License: Apache-2.0 | Module:


Package Files

func Message

func Message(msgAndArgs ...interface{}) string

Message accepts a msgAndArgs varargs and formats it using fmt.Sprintf

func UnifiedDiff

func UnifiedDiff(conf DiffConfig) string

UnifiedDiff is a modified version of difflib.WriteUnifiedDiff with better support for showing the whitespace differences.

func WithCustomMessage

func WithCustomMessage(source string, msgAndArgs ...interface{}) string

WithCustomMessage accepts one or two messages and formats them appropriately

type DiffConfig

type DiffConfig struct {
	A    string
	B    string
	From string
	To   string

DiffConfig for a unified diff

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier