style: edit error messages to start with lowercase
This commit is contained in:
parent
c8e61a9cf8
commit
c5a09be93f
@ -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))
|
||||||
|
@ -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)
|
||||||
|
4
main.go
4
main.go
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user