package diff
import "github.com/andreyvit/diff"
diff provides quick and easy string diffing functions based on github.com/sergi/go-diff, mainly for diffing strings in tests
Index ¶
- func CharacterDiff(a, b string) string
- func LineDiff(a, b string) string
- func LineDiffAsLines(a, b string) []string
- func TrimLines(input []string) []string
- func TrimLinesInString(input string) string
Functions ¶
func CharacterDiff ¶
CharacterDiff returns an inline diff between the two strings, using (++added++) and (~~deleted~~) markup.
func LineDiff ¶
LineDiff returns a normal linewise diff between the two given strings.
func LineDiffAsLines ¶
LineDiffAsLines returns the lines of a linewise diff between the two given strings.
func TrimLines ¶
TrimLines applies TrimSpace to each string in the given array.
func TrimLinesInString ¶
TrimLinesInString applies TrimSpace to each line in the given string, and returns the new trimmed string. Empty lines are not removed.
Source Files ¶
- Version
- v0.0.0-20170406064948-c7f18ee00883 (latest)
- Published
- Apr 6, 2017
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 1 month ago –
Tools for package owners.