Merge pull request #18931 from vrothberg/lint

bump golangci-lint to v1.53.3
This commit is contained in:
OpenShift Merge Robot
2023-06-20 06:01:50 -04:00
committed by GitHub
25 changed files with 101 additions and 39 deletions

View File

@ -106,7 +106,7 @@ func add(cmd *cobra.Command, args []string) error {
Default: cOpts.Default,
}
dest := args[1]
if match, err := regexp.Match("^[A-Za-z][A-Za-z0-9+.-]*://", []byte(dest)); err != nil {
if match, err := regexp.MatchString("^[A-Za-z][A-Za-z0-9+.-]*://", dest); err != nil {
return fmt.Errorf("invalid destination: %w", err)
} else if !match {
dest = "ssh://" + dest
@ -203,7 +203,7 @@ func create(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
if match, err := regexp.Match("^[A-Za-z][A-Za-z0-9+.-]*://", []byte(dest)); err != nil {
if match, err := regexp.MatchString("^[A-Za-z][A-Za-z0-9+.-]*://", dest); err != nil {
return fmt.Errorf("invalid destination: %w", err)
} else if !match {
dest = "ssh://" + dest

View File

@ -64,7 +64,7 @@ func logToKmsg(s string) bool {
kmsgFile = f
}
if _, err := kmsgFile.Write([]byte(s)); err != nil {
if _, err := kmsgFile.WriteString(s); err != nil {
kmsgFile.Close()
kmsgFile = nil
return false