style: edit error messages to start with lowercase
This commit is contained in:
parent
00f514de4a
commit
39bd97487b
@ -10,7 +10,7 @@ func gitUserData(key string) (string, error) {
|
||||
cmd := exec.Command("git", "config", "--get", key)
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
return "", errors.New("Can't read Git config")
|
||||
return "", errors.New("can't read Git config")
|
||||
}
|
||||
|
||||
value := strings.TrimSpace(string(out))
|
||||
|
@ -37,7 +37,7 @@ func (l *Licenser) ParseTemplate() (LicenseTemplate, error) {
|
||||
func (l *Licenser) Generate() error {
|
||||
license, err := l.ParseTemplate()
|
||||
if err != nil {
|
||||
return errors.New("Not supported license")
|
||||
return errors.New("usupported license")
|
||||
}
|
||||
|
||||
tmpl, _ := template.New(l.LicenseID).Parse(license.Body)
|
||||
|
4
main.go
4
main.go
@ -26,7 +26,7 @@ func main() {
|
||||
}
|
||||
|
||||
licenseCtx, err := NewLicenseContext(*AuthorName, *AuthorEmail)
|
||||
if err != nil && err.Error() == "Can't read Git config" {
|
||||
if err != nil && err.Error() == "can't read Git config" {
|
||||
fmt.Printf(
|
||||
"Error: Can't read Git config.\n\nUse --name \"NAME\" and --email EMAIL instead.\n",
|
||||
)
|
||||
@ -40,7 +40,7 @@ func main() {
|
||||
}
|
||||
|
||||
err = licenser.Generate()
|
||||
if err != nil && err.Error() == "Not supported license" {
|
||||
if err != nil && err.Error() == "usupported license" {
|
||||
fmt.Printf("Error: There is no '%s' license\n\nAvailable licenses:\n", *LicenseID)
|
||||
listLicenses()
|
||||
os.Exit(2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user