diff

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package diff implements a Diff function that compare two inputs using the 'diff' tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(prefix string, b1, b2 []byte) ([]byte, error)

Diff returns diff of two arrays of bytes in diff tool format.

func ReplaceTempFilename

func ReplaceTempFilename(diff []byte, filename string) ([]byte, error)

ReplaceTempFilename replaces temporary filenames in diff with actual one.

ref: https://github.com/golang/tools/blob/master/cmd/goimports/goimports.go

Example:

--- /tmp/gofmt316145376	2017-02-03 19:13:00.280468375 -0500
+++ /tmp/gofmt617882815	2017-02-03 19:13:00.280468375 -0500
...
->
--- path/to/file.go.orig	2017-02-03 19:13:00.280468375 -0500
+++ path/to/file.go	2017-02-03 19:13:00.280468375 -0500
...

Types

This section is empty.

Jump to

Keyboard shortcuts

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