Skip to content

Commit

Permalink
fix: conflict import name with variable (#1879)
Browse files Browse the repository at this point in the history
`template` is an import in `cobra.go` file and also used as a variable
name, which masks the library in the scope of that function.
  • Loading branch information
yashLadha committed Dec 15, 2022
1 parent 9235920 commit f25a3c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cobra.go
Expand Up @@ -167,8 +167,8 @@ func appendIfNotPresent(s, stringToAppend string) string {

// rpad adds padding to the right of a string.
func rpad(s string, padding int) string {
template := fmt.Sprintf("%%-%ds", padding)
return fmt.Sprintf(template, s)
formattedString := fmt.Sprintf("%%-%ds", padding)
return fmt.Sprintf(formattedString, s)
}

// tmpl executes the given template text on data, writing the result to w.
Expand Down

0 comments on commit f25a3c6

Please sign in to comment.