goctl added
This commit is contained in:
13
tools/goctl/api/util/annotation.go
Normal file
13
tools/goctl/api/util/annotation.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package util
|
||||
|
||||
import "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
|
||||
}
|
||||
Reference in New Issue
Block a user