diff

package
Version: v0.0.0-...-99c9ca1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareFiles

func CompareFiles(a, b string) ([]byte, error)

CompareFiles returns the diff between files a, b.

func WalkAndCompare

func WalkAndCompare(dir, mask string, filename string, cmp func(*FileInfo, *FileInfo) bool) ([]byte, error)

WalkAndCompare walks dir, looking for files matching the supplied regexp mask, successively comparing each against filename. The first having a diff (compared by most recent first) will be returned.

Useful for comparing multiple files to find the most recent difference from a set of files matching mask that likely have the same content.

Types

type FileInfo

type FileInfo struct {
	Name string
	Info os.FileInfo
}

FileInfo contains file information.

func FindFilesWithMask

func FindFilesWithMask(dir, mask string, exclude ...string) ([]*FileInfo, error)

FindFilesWithMask walks dir finding all files with the regexp mask, removing any exclude'd files.

func (*FileInfo) String

func (fi *FileInfo) String() string

String satisfies fmt.Stringer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL