From 71eded92eccf68ce049875379660f13dcbf85bec Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Sat, 18 Nov 2017 20:07:14 +0900 Subject: [PATCH] Capitalize first letters of error messages --- url_result.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/url_result.go b/url_result.go index fca2c10..f7ded01 100644 --- a/url_result.go +++ b/url_result.go @@ -1,6 +1,10 @@ package main -import "github.com/fatih/color" +import ( + "strings" + + "github.com/fatih/color" +) type urlResult struct { url string @@ -12,5 +16,8 @@ func (r urlResult) String() string { return color.GreenString("OK") + "\t" + r.url } - return color.RedString("ERROR") + "\t" + r.url + "\n\t" + color.YellowString(r.err.Error()) + s := r.err.Error() + + return color.RedString("ERROR") + "\t" + r.url + "\n\t" + + color.YellowString(strings.ToUpper(s[:1])+s[1:]) }