From d42fb0e93f544fbd87cf86ddbce5dd6c173d4ede Mon Sep 17 00:00:00 2001 From: Billy Keyes Date: Sun, 14 Apr 2019 19:53:39 -0700 Subject: [PATCH] Fix spelling mistakes, add Go Report Card badge --- README.md | 2 +- gitdiff/file_header.go | 2 +- gitdiff/file_header_test.go | 2 +- gitdiff/gitdiff.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1e24f87..6e5f9a2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # go-gitdiff -[![GoDoc](https://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff?status.svg)](http://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff) +[![GoDoc](https://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff?status.svg)](http://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff) [![Go Report Card](https://goreportcard.com/badge/github.com/bluekeyes/go-gitdiff)](https://goreportcard.com/report/github.com/bluekeyes/go-gitdiff) A Go library for parsing and applying patches generated by `git diff`, `git show`, and `git format-patch`. It can also parse and apply unified diffs diff --git a/gitdiff/file_header.go b/gitdiff/file_header.go index 781a448..e3c5c0d 100644 --- a/gitdiff/file_header.go +++ b/gitdiff/file_header.go @@ -302,7 +302,7 @@ func parseMode(s string) (os.FileMode, error) { // parseName extracts a file name from the start of a string and returns the // name and the index of the first character after the name. If the name is -// unquoted and term is non-negative, parsing stops at the first occurance of +// unquoted and term is non-negative, parsing stops at the first occurrence of // term. Otherwise parsing of unquoted names stops at the first space or tab. // // If the name is exactly "/dev/null", no further processing occurs. Otherwise, diff --git a/gitdiff/file_header_test.go b/gitdiff/file_header_test.go index eee683a..52adda5 100644 --- a/gitdiff/file_header_test.go +++ b/gitdiff/file_header_test.go @@ -368,7 +368,7 @@ func TestParseName(t *testing.T) { } if output != test.Output { - t.Errorf("incorect output: expected %q, actual: %q", test.Output, output) + t.Errorf("incorrect output: expected %q, actual: %q", test.Output, output) } if n != test.N { t.Errorf("incorrect next position: expected %d, actual %d", test.N, n) diff --git a/gitdiff/gitdiff.go b/gitdiff/gitdiff.go index d7b1266..8e886eb 100644 --- a/gitdiff/gitdiff.go +++ b/gitdiff/gitdiff.go @@ -56,7 +56,7 @@ type TextFragment struct { Lines []Line } -// Header returns the cannonical header of this fragment. +// Header returns the canonical header of this fragment. func (f *TextFragment) Header() string { return fmt.Sprintf("@@ -%d,%d +%d,%d @@ %s", f.OldPosition, f.OldLines, f.NewPosition, f.NewLines, f.Comment) }