mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 09:40:24 +08:00
5c0c3ea467
* rebase upstream * rebase * trim no need line * trim no need line * trim no need line * trim space Co-authored-by: kingxt <dream4kingxt@163.com>
18 lines
334 B
Go
18 lines
334 B
Go
package util
|
|
|
|
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 strings.TrimSpace(value), ok
|
|
}
|
|
}
|
|
return "", false
|
|
}
|