package annotation // @Inject(name? string) import ( "strings" ) const ( InjectTag = "@Inject" ) type Inject struct { Annotation Name string } func ParseInject(a string) (*Inject, error) { i := strings.Index(a, InjectTag) if -1 == i { return nil, nil } inject := &Inject{} atts, err := ParseAttribute(a, i+len(InjectTag)) if nil != err { return nil, err } for k, v := range atts { switch k { case "name": inject.Name = v } } return inject, nil }