1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 20:41:57 +00:00

formatting

Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-08-17 10:06:20 +03:00
parent 00967408dc
commit 07046ab978
112 changed files with 477 additions and 517 deletions

View File

@@ -88,7 +88,7 @@ func MakeFuncInjector(fn reflect.Value, hijack Hijacker, goodFunc TypeChecker, v
// again, a next value even with the same type is able to be
// used to other input arg. One value per input argument, order
// matters if same type of course.
//if len(values) > j+1 {
// if len(values) > j+1 {
values = append(values[:j], values[j+1:]...)
//}
@@ -126,7 +126,6 @@ func (s *FuncInjector) addValue(inputIndex int, value reflect.Value) bool {
// the binded values to the func's inputs.
b, err := MakeBindObject(value, s.goodFunc)
if err != nil {
return false
}
@@ -197,7 +196,6 @@ func (s *FuncInjector) Inject(in *[]reflect.Value, ctx ...reflect.Value) {
// input.InputIndex, v.String(), v.Type().Name())
args[input.InputIndex] = v
})
}
*in = args

View File

@@ -124,9 +124,8 @@ func (bv *Values) AddOnce(value interface{}) bool {
}
func (bv *Values) addIfNotExists(v reflect.Value) bool {
var (
typ = v.Type() // no element, raw things here.
)
typ := v.Type() // no element, raw things here.
if !goodVal(v) {
return false

View File

@@ -95,7 +95,6 @@ func DispatchErr(ctx context.Context, status int, err error) {
// commonly used data to the response writer with a smart way.
func DispatchCommon(ctx context.Context,
statusCode int, contentType string, content []byte, v interface{}, err error, found bool) {
// if we have a false boolean as a return value
// then skip everything and fire a not found,
// we even don't care about the given status code or the object or the content.

View File

@@ -11,9 +11,7 @@ import (
"github.com/kataras/golog"
)
var (
contextTyp = reflect.TypeOf((*context.Context)(nil)).Elem()
)
var contextTyp = reflect.TypeOf((*context.Context)(nil)).Elem()
// IsContext returns true if the "inTyp" is a type of Context.
func IsContext(inTyp reflect.Type) bool {
@@ -95,5 +93,4 @@ func makeHandler(handler interface{}, values ...reflect.Value) (context.Handler,
}
return h, nil
}

View File

@@ -44,5 +44,4 @@ func TestPathParams(t *testing.T) {
if got != expected {
t.Fatalf("expected the params 'firstname' + 'lastname' to be '%s' but got '%s'", expected, got)
}
}