Back to / internal / format

Package format

Latest Go to latest

The latest major version is v3.

Published: Mar 21, 2018 | License: Apache-2.0 | Module:


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

Package Files

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

Jump to identifier

Keyboard shortcuts

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