mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 09:57:01 +00:00
use the new protobuf package and other minor stuff
Former-commit-id: 29bf71e8a73d34b27c6f5fe3f12c4ea1cc2b84b2
This commit is contained in:
@@ -343,7 +343,7 @@ func TestBindingsForStruct(t *testing.T) {
|
||||
|
||||
controller3 struct {
|
||||
Emb1 embedded1
|
||||
emb2 embedded2
|
||||
emb2 embedded2 // unused
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ func resolveDependency(v reflect.Value, dest *Dependency, funcDependencies ...*D
|
||||
len(funcDependencies) > 0 && fromDependentFunc(v, dest, funcDependencies)
|
||||
}
|
||||
|
||||
func fromDependencyHandler(v reflect.Value, dest *Dependency) bool {
|
||||
func fromDependencyHandler(_ reflect.Value, dest *Dependency) bool {
|
||||
// It's already on the desired form, just return it.
|
||||
dependency := dest.OriginalValue
|
||||
handler, ok := dependency.(DependencyHandler)
|
||||
|
||||
@@ -4,10 +4,10 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/kataras/iris/v12/context"
|
||||
|
||||
"github.com/fatih/structs"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// ResultHandler describes the function type which should serve the "v" struct value.
|
||||
|
||||
@@ -15,15 +15,6 @@ func valueOf(v interface{}) reflect.Value {
|
||||
return reflect.ValueOf(v)
|
||||
}
|
||||
|
||||
func typeOf(typ interface{}) reflect.Type {
|
||||
if v, ok := typ.(reflect.Type); ok {
|
||||
// check if it's already a reflect.Type.
|
||||
return v
|
||||
}
|
||||
|
||||
return reflect.TypeOf(typ)
|
||||
}
|
||||
|
||||
// indirectType returns the value of a pointer-type "typ".
|
||||
// If "typ" is a pointer, array, chan, map or slice it returns its Elem,
|
||||
// otherwise returns the typ as it's.
|
||||
|
||||
Reference in New Issue
Block a user