@@ -285,7 +285,7 @@ func (c *Container) findBeans(s gs.BeanSelector) ([]BeanRuntime, error) {
285285 }
286286 var ret []BeanRuntime
287287 for _ , b := range beans {
288- if b . Match ( s .Name ) {
288+ if s .Name == b . Name ( ) {
289289 ret = append (ret , b )
290290 }
291291 }
@@ -309,10 +309,9 @@ func (c *Container) getBean(t reflect.Type, tag wireTag, stack *WiringStack) (Be
309309 if b .Status () == gs_bean .StatusDeleted {
310310 continue
311311 }
312- if ! b . Match ( tag .beanName ) {
313- continue
312+ if tag . beanName == "" || tag .beanName == b . Name ( ) {
313+ foundBeans = append ( foundBeans , b )
314314 }
315- foundBeans = append (foundBeans , b )
316315 }
317316
318317 // When a specific bean name is provided, find it by name.
@@ -324,7 +323,7 @@ func (c *Container) getBean(t reflect.Type, tag wireTag, stack *WiringStack) (Be
324323 if ! b .Type ().AssignableTo (t ) {
325324 continue
326325 }
327- if ! b . Match ( tag .beanName ) {
326+ if tag . beanName != "" && tag .beanName != b . Name ( ) {
328327 continue
329328 }
330329
@@ -429,7 +428,7 @@ func (c *Container) getBeans(t reflect.Type, tags []wireTag, nullable bool, stac
429428
430429 var founds []int
431430 for i , b := range beans {
432- if b . Match ( item .beanName ) {
431+ if item .beanName == b . Name ( ) {
433432 founds = append (founds , i )
434433 }
435434 }
0 commit comments