Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2015-03-06 01:19:10 +0300
committerbep <bjorn.erik.pedersen@gmail.com>2015-03-06 01:57:38 +0300
commit6e1b0e0c00ced52979b8629161e36e45d51a47e6 (patch)
treee204d6b37c86ecab8fdfc63ec9143f12abaef6f4 /utils
parent8557e2cbb821663a5a482d904b031dff831b06cc (diff)
Apply gofmt -s
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.go6
-rw-r--r--utils/utils_test.go18
2 files changed, 11 insertions, 13 deletions
diff --git a/utils/utils.go b/utils/utils.go
index eaa6c09a9..ea89ec745 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -45,13 +45,13 @@ func StopOnErr(err error, s ...string) {
// cutUsageMessage splits the incoming string on the beginning of the usage
// message text. Anything in the first element of the returned slice, trimmed
-// of its Unicode defined spaces, should be returned. The 2nd element of the
+// of its Unicode defined spaces, should be returned. The 2nd element of the
// slice will have the usage message that we wish to elide.
//
// This is done because Cobra already prints Hugo's usage message; not eliding
-// would result in the usage output being printed twice, which leads to bug
+// would result in the usage output being printed twice, which leads to bug
// reports, more specifically: https://github.com/spf13/hugo/issues/374
func cutUsageMessage(s string) string {
- pieces := strings.Split(s, "Usage of")
+ pieces := strings.Split(s, "Usage of")
return strings.TrimSpace(pieces[0])
}
diff --git a/utils/utils_test.go b/utils/utils_test.go
index 0bb92dea8..7c47ef970 100644
--- a/utils/utils_test.go
+++ b/utils/utils_test.go
@@ -2,21 +2,19 @@ package utils
import (
"testing"
- )
-
-
+)
func TestCutUsageMessage(t *testing.T) {
- tests := []struct{
- message string
+ tests := []struct {
+ message string
cutMessage string
}{
{"", ""},
- {" Usage of hugo: \n -b, --baseUrl=...", ""},
- {"Some error Usage of hugo: \n", "Some error"},
- {"Usage of hugo: \n -b --baseU", ""},
- {"CRITICAL error for usage of hugo ", "CRITICAL error for usage of hugo"},
- {"Invalid short flag a in -abcde", "Invalid short flag a in -abcde"},
+ {" Usage of hugo: \n -b, --baseUrl=...", ""},
+ {"Some error Usage of hugo: \n", "Some error"},
+ {"Usage of hugo: \n -b --baseU", ""},
+ {"CRITICAL error for usage of hugo ", "CRITICAL error for usage of hugo"},
+ {"Invalid short flag a in -abcde", "Invalid short flag a in -abcde"},
}
for _, test := range tests {