Merge pull request #6291 from seanlaii/fix-QF1004
Fix lint issue QF1004
This commit is contained in:
commit
a05c7dc006
|
@ -71,7 +71,6 @@ linters:
|
|||
# Issue: https://github.com/karmada-io/karmada/issues/6273.
|
||||
- "-QF1008"
|
||||
- "-ST1005"
|
||||
- "-QF1004"
|
||||
- "-ST1011"
|
||||
- "-QF1003"
|
||||
- "-QF1001"
|
||||
|
|
|
@ -35,7 +35,7 @@ func MarkdownPostProcessing(cmd *cobra.Command, dir string, processor func(strin
|
|||
}
|
||||
}
|
||||
|
||||
basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".md"
|
||||
basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + ".md"
|
||||
filename := filepath.Join(dir, basename)
|
||||
|
||||
// Remove the markdown file for the version subcommand
|
||||
|
|
|
@ -46,7 +46,7 @@ func PrintCLIByTag(cmd *cobra.Command, all []*cobra.Command, tag string) string
|
|||
}
|
||||
cname := cmd.Name() + " " + c.Name()
|
||||
link := cname
|
||||
link = strings.Replace(link, " ", "_", -1) + ".md"
|
||||
link = strings.ReplaceAll(link, " ", "_") + ".md"
|
||||
pl = append(pl, fmt.Sprintf("* [%s](%s)\t - %s\n", cname, link, c.Long))
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ func PrintCLIByTag(cmd *cobra.Command, all []*cobra.Command, tag string) string
|
|||
|
||||
// GenMarkdownTreeForIndex generate the index page for karmadactl
|
||||
func GenMarkdownTreeForIndex(cmd *cobra.Command, dir string) error {
|
||||
basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + "_index" + ".md"
|
||||
basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + "_index" + ".md"
|
||||
filename := filepath.Join(dir, basename)
|
||||
f, err := os.OpenFile(filename, os.O_CREATE|os.O_RDWR, pkgutil.DefaultFilePerm)
|
||||
if err != nil {
|
||||
|
|
|
@ -138,7 +138,7 @@ func GenerateRegisterCommand(kubeConfig, parentCommand, token string, karmadaCon
|
|||
}
|
||||
|
||||
return fmt.Sprintf("%s register %s --token %s --discovery-token-ca-cert-hash %s",
|
||||
parentCommand, strings.Replace(clusterConfig.Server, "https://", "", -1),
|
||||
parentCommand, strings.ReplaceAll(clusterConfig.Server, "https://", ""),
|
||||
token, strings.Join(publicKeyPins, ",")), nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue