Jelajahi Sumber

trim space (#31)

* rebase upstream

* rebase

* trim no need line

* trim no need line

* trim no need line

* trim space

Co-authored-by: kingxt <dream4kingxt@163.com>
kingxt 4 tahun lalu
induk
melakukan
5c0c3ea467
1 mengubah file dengan 6 tambahan dan 2 penghapusan
  1. 6 2
      tools/goctl/api/util/annotation.go

+ 6 - 2
tools/goctl/api/util/annotation.go

@@ -1,12 +1,16 @@
 package util
 
-import "github.com/tal-tech/go-zero/tools/goctl/api/spec"
+import (
+	"strings"
+
+	"github.com/tal-tech/go-zero/tools/goctl/api/spec"
+)
 
 func GetAnnotationValue(annos []spec.Annotation, key, field string) (string, bool) {
 	for _, anno := range annos {
 		if anno.Name == key {
 			value, ok := anno.Properties[field]
-			return value, ok
+			return strings.TrimSpace(value), ok
 		}
 	}
 	return "", false