Back to godoc.org

Package textutil

v1.6.2
Latest Go to latest

The latest major version is .

Published: Aug 30, 2020 | License: BSD-3-Clause | Module: github.com/rogpeppe/go-internal

Overview

package textutil contains text processing utilities.

This package came to life as a result of refactoring code common to internal packages we have factored out of the Go repo.

Index

func Diff

func Diff(text1, text2 string) string

Diff returns a formatted diff of the two texts, showing the entire text and the minimum line-level additions and removals to turn text1 into text2. (That is, lines only in text1 appear with a leading -, and lines only in text2 appear with a leading +.)

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

Jump to identifier

Keyboard shortcuts

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