mirror of https://github.com/spf13/cobra.git
fix: conflict import name with variable (#1879)
`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.
This commit is contained in:
parent
923592041e
commit
f25a3c6e0b
4
cobra.go
4
cobra.go
|
@ -167,8 +167,8 @@ func appendIfNotPresent(s, stringToAppend string) string {
|
||||||
|
|
||||||
// rpad adds padding to the right of a string.
|
// rpad adds padding to the right of a string.
|
||||||
func rpad(s string, padding int) string {
|
func rpad(s string, padding int) string {
|
||||||
template := fmt.Sprintf("%%-%ds", padding)
|
formattedString := fmt.Sprintf("%%-%ds", padding)
|
||||||
return fmt.Sprintf(template, s)
|
return fmt.Sprintf(formattedString, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// tmpl executes the given template text on data, writing the result to w.
|
// tmpl executes the given template text on data, writing the result to w.
|
||||||
|
|
Loading…
Reference in New Issue