···11# go-gitdiff
2233-[](http://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff)
33+[](http://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff) [](https://goreportcard.com/report/github.com/bluekeyes/go-gitdiff)
4455A Go library for parsing and applying patches generated by `git diff`, `git
66show`, and `git format-patch`. It can also parse and apply unified diffs
+1-1
gitdiff/file_header.go
···302302303303// parseName extracts a file name from the start of a string and returns the
304304// name and the index of the first character after the name. If the name is
305305-// unquoted and term is non-negative, parsing stops at the first occurance of
305305+// unquoted and term is non-negative, parsing stops at the first occurrence of
306306// term. Otherwise parsing of unquoted names stops at the first space or tab.
307307//
308308// If the name is exactly "/dev/null", no further processing occurs. Otherwise,
+1-1
gitdiff/file_header_test.go
···368368 }
369369370370 if output != test.Output {
371371- t.Errorf("incorect output: expected %q, actual: %q", test.Output, output)
371371+ t.Errorf("incorrect output: expected %q, actual: %q", test.Output, output)
372372 }
373373 if n != test.N {
374374 t.Errorf("incorrect next position: expected %d, actual %d", test.N, n)
+1-1
gitdiff/gitdiff.go
···5656 Lines []Line
5757}
58585959-// Header returns the cannonical header of this fragment.
5959+// Header returns the canonical header of this fragment.
6060func (f *TextFragment) Header() string {
6161 return fmt.Sprintf("@@ -%d,%d +%d,%d @@ %s", f.OldPosition, f.OldLines, f.NewPosition, f.NewLines, f.Comment)
6262}