Browse Source

fix: product config cmd tool vendor argument trim space

luzhenqian 4 years ago
parent
commit
6a60449206
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tools/pdcfg/vendor.go

+ 2 - 2
tools/pdcfg/vendor.go

@@ -21,14 +21,14 @@ func addVendor() error {
 	if err != nil {
 		return err
 	}
-	args.VendorName = strings.Replace(name, "\n", "", -1)
+	args.VendorName = strings.TrimSpace(name)
 
 	fmt.Printf("vendor description: ")
 	desc, err := reader.ReadString('\n')
 	if err != nil {
 		return err
 	}
-	args.VendorDescription = strings.Replace(desc, "\n", "", -1)
+	args.VendorDescription = strings.TrimSpace(desc)
 
 	reply := &models.Vendor{}