Fix variable shadowing in author detection

This commit is contained in:
Steve Yegge
2025-10-27 22:30:20 -07:00
parent 9dcfa88711
commit c69d4b4adb

View File

@@ -130,17 +130,17 @@ Examples:
// Get author from author flag, BD_ACTOR var, or system USER var
author, _ := cmd.Flags().GetString("author")
if author == "" {
author := os.Getenv("BD_ACTOR")
if author == "" {
author = os.Getenv("USER")
}
if author == "" {
if u, err := user.Current(); err == nil {
author = u.Username
} else {
author = "unknown"
}
}
author = os.Getenv("BD_ACTOR")
if author == "" {
author = os.Getenv("USER")
}
if author == "" {
if u, err := user.Current(); err == nil {
author = u.Username
} else {
author = "unknown"
}
}
}
var comment *types.Comment