diffview

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: MIT Imports: 9 Imported by: 0

README

diffview

This library opens your favourite diff viewer directly from your tests.

why

I did a lot of testing recently where I had to compare complex structs and or strings.

I really like the GoLand diff viewer.

I absolutely hated to copy stuff from the console to two files in order to use the GoLand diff view. So here is diffview.

current caveats

It should not run from within CI. I guess a testing flag should do. I'll fix this soon/contributions welcome.

usage


package diffview

import "testing"

var (
	a = `foo
bar
baz
`
	b = `foo
baz
bar`
)

func TestGolandDiffView(t *testing.T) {
	NewGoland().DiffViewBytes("test", []byte(a), []byte(b))
}

contributing

Feel free to add Openers for different operating systems/diff view tools.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffViewer

type DiffViewer struct {
	// contains filtered or unexported fields
}

func NewGoland

func NewGoland() DiffViewer

func (DiffViewer) DiffViewAny

func (d DiffViewer) DiffViewAny(name string, a, b interface{})

func (DiffViewer) DiffViewBytes

func (d DiffViewer) DiffViewBytes(name string, a, b []byte)

func (DiffViewer) DiffViewReader

func (d DiffViewer) DiffViewReader(name string, a, b io.Reader)

Jump to

Keyboard shortcuts

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