1
0

style: edit error messages to start with lowercase

This commit is contained in:
Wiktor Zykubek 2024-12-29 05:51:16 +01:00
parent c8e61a9cf8
commit c5a09be93f
Signed by: wzykubek
GPG Key ID: 2221881F957D89B9
3 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ func gitUserData(key string) (string, error) {
cmd := exec.Command("git", "config", "--get", key) cmd := exec.Command("git", "config", "--get", key)
out, err := cmd.Output() out, err := cmd.Output()
if err != nil { if err != nil {
return "", errors.New("Can't read Git config") return "", errors.New("can't read Git config")
} }
value := strings.TrimSpace(string(out)) value := strings.TrimSpace(string(out))

View File

@ -37,7 +37,7 @@ func (l *Licenser) ParseTemplate() (LicenseTemplate, error) {
func (l *Licenser) Generate() error { func (l *Licenser) Generate() error {
license, err := l.ParseTemplate() license, err := l.ParseTemplate()
if err != nil { if err != nil {
return errors.New("Not supported license") return errors.New("usupported license")
} }
tmpl, _ := template.New(l.LicenseID).Parse(license.Body) tmpl, _ := template.New(l.LicenseID).Parse(license.Body)

View File

@ -26,7 +26,7 @@ func main() {
} }
licenseCtx, err := NewLicenseContext(*AuthorName, *AuthorEmail) 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( fmt.Printf(
"Error: Can't read Git config.\n\nUse --name \"NAME\" and --email EMAIL instead.\n", "Error: Can't read Git config.\n\nUse --name \"NAME\" and --email EMAIL instead.\n",
) )
@ -40,7 +40,7 @@ func main() {
} }
err = licenser.Generate() 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) fmt.Printf("Error: There is no '%s' license\n\nAvailable licenses:\n", *LicenseID)
listLicenses() listLicenses()
os.Exit(2) os.Exit(2)