aboutsummaryrefslogtreecommitdiffstats
path: root/common.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2015-12-12 03:22:52 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2015-12-12 03:22:52 +0100
commitb543e4e02793a58db25148214ef149cb571792f5 (patch)
treed68b7e33aba06f67d3c3e301b4a68f09de0ded6a /common.go
parentc22c181f70e0afb294513315e9975b9f3f4c1d39 (diff)
downloadgo-git-b543e4e02793a58db25148214ef149cb571792f5.tar.gz
blame code reorganization, and mutting the test
Diffstat (limited to 'common.go')
-rw-r--r--common.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/common.go b/common.go
index 51486b8..6174339 100644
--- a/common.go
+++ b/common.go
@@ -2,17 +2,19 @@ package git
import "strings"
-// CountLines returns the number of lines in a string à la git, this is
+// countLines returns the number of lines in a string à la git, this is
// The newline character is assumed to be '\n'. The empty string
// contains 0 lines. If the last line of the string doesn't end with a
// newline, it will still be considered a line.
-func CountLines(s string) int {
+func countLines(s string) int {
if s == "" {
return 0
}
- nEol := strings.Count(s, "\n")
+
+ nEOL := strings.Count(s, "\n")
if strings.HasSuffix(s, "\n") {
- return nEol
+ return nEOL
}
- return nEol + 1
+
+ return nEOL + 1
}