conflict

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var All = []Conflict{}
View Source
var Count int
View Source
var FileLines map[string][]string

Functions

func Find

func Find() (err error)

func ReadFile

func ReadFile(absPath string) error

func RunCommand

func RunCommand(name string, dir string, args ...string) (stdout string, stderr string, exitCode int)

RunCommand runs the given command with arguemtns and returns the output Refer to https://stackoverflow.com/questions/10385551/get-exit-code-go

Types

type Conflict

type Conflict struct {
	Choice       int
	FileName     string
	AbsolutePath string
	Start        int
	Middle       int
	End          int

	LocalLines           []string
	IncomingLines        []string
	ColoredLocalLines    []string
	ColoredIncomingLines []string

	CurrentName string
	ForeignName string

	TopPeek     int
	BottomPeek  int
	DisplayDiff bool
}

Conflict represents a single conflict that may have occured

func In

func In(fname string) (list []Conflict)

func New

func New(fname string, cwd string, lines []int) ([]Conflict, error)

func (*Conflict) Diff

func (c *Conflict) Diff() []string

func (*Conflict) Equal

func (c *Conflict) Equal(c2 *Conflict) bool

func (*Conflict) ExtractLines

func (c *Conflict) ExtractLines() error

func (*Conflict) PaddingLines

func (c *Conflict) PaddingLines() (topPadding, bottomPadding []string)

func (*Conflict) SyntaxHighlight

func (c *Conflict) SyntaxHighlight() error

func (*Conflict) ToggleDiff

func (c *Conflict) ToggleDiff()

type ErrNoConflict

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

func NewErrNoConflict

func NewErrNoConflict(message string) *ErrNoConflict

func (*ErrNoConflict) Error

func (e *ErrNoConflict) Error() string

Jump to

Keyboard shortcuts

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