From 5c0c3ea467395e01246c4621a4921a1fc697d194 Mon Sep 17 00:00:00 2001 From: kingxt Date: Tue, 1 Sep 2020 11:46:10 +0800 Subject: [PATCH] trim space (#31) * rebase upstream * rebase * trim no need line * trim no need line * trim no need line * trim space Co-authored-by: kingxt --- tools/goctl/api/util/annotation.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/goctl/api/util/annotation.go b/tools/goctl/api/util/annotation.go index e4dc0073..982a48b1 100644 --- a/tools/goctl/api/util/annotation.go +++ b/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