mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-25 02:08:44 +08:00
14 lines
298 B
Go
14 lines
298 B
Go
package util
|
|
|
|
import "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 "", false
|
|
}
|