Skip to content

Commit

Permalink
chore: remove name for LocalStubFnInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Oct 28, 2024
1 parent 7af0b0b commit 07ef6a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion internal/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
// LocalStubFnInfo is the information passed to LocalStubFn.
type LocalStubFnInfo struct {
Impl any
Name string
Interceptor interceptor.Interceptor
}

Expand Down
7 changes: 3 additions & 4 deletions registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,20 @@ func (k *Kod) getIntf(ctx context.Context, t reflect.Type) (any, error) {
return intf, nil
}

comp, err := k.get(ctx, reg)
impl, err := k.get(ctx, reg)
if err != nil {
return nil, err
}

interceptors := k.opts.interceptors
if h, ok := comp.(interface {
if h, ok := impl.(interface {
Interceptors() []interceptor.Interceptor
}); ok {
interceptors = append(interceptors, h.Interceptors()...)
}

info := &LocalStubFnInfo{
Name: reg.Name,
Impl: comp,
Impl: impl,
Interceptor: interceptor.Chain(interceptors),
}

Expand Down

0 comments on commit 07ef6a3

Please sign in to comment.