Skip to content

Commit

Permalink
Fix return type
Browse files Browse the repository at this point in the history
  • Loading branch information
olbrichattila committed Jul 30, 2024
1 parent b307707 commit c5504be
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions godi.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// Package godi is the wrapper around dependency injection container
package godi

import "github.com/olbrichattila/godi/internal/container"
import (
"reflect"

"github.com/olbrichattila/godi/internal/container"
)

// Container is an just a wrapper around the internal container to be able to modify the implementation without effecting end users if they would think of referencing the sub package
type Container interface {
Expand All @@ -13,7 +17,7 @@ type Container interface {
Flush()
Delete(paramName string)
Count() int
Call(interface{}, ...interface{}) (interface{}, error)
Call(interface{}, ...interface{}) ([]reflect.Value, error)
}

// Cont is the container structure which follows Container interface
Expand Down Expand Up @@ -67,6 +71,6 @@ func (t *Cont) Count() int {
}

// Call can invoke a function auto resolving dependencies and passing optional extra parameters at the beginning
func (t *Cont) Call(fn interface{}, params ...interface{}) (interface{}, error) {
func (t *Cont) Call(fn interface{}, params ...interface{}) ([]reflect.Value, error) {
return t.c.Call(fn, params...)
}

0 comments on commit c5504be

Please sign in to comment.