// Return specifies the return arguments for the expectation.
//
//    mock.On(r.Table("test")).Return(nil, errors.New("failed"))
320395
func (mq *MockQuery) Return(response interface{}, err error) *MockQuery {
	mq.lock()
	defer mq.unlock()

	mq.Response = response
	mq.Error = err

	return mq
}
1157171
func (m *MockEventInterface) Get(arg0 string, arg1 v10.GetOptions) (*v1.Event, error) {
	ret := m.ctrl.Call(m, "Get", arg0, arg1)
	ret0, _ := ret[0].(*v1.Event)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
1062233
func AssertEqual(expected interface{}, result interface{}) {
	AssertType(expected, result)
	if expected == nil && result == nil {
		return
	}
	switch result.(type) {
	case string, int, error, bool:
		if expected != result {
			panic(fmt.Sprintf("Error: [] Mismatched Values\nExpected value: %v\nResult: %v", expected, result))
		}
	default:
		panic("Error: AssertEqual doesn't handles this type yet.")
	}

}
539096
func (e *Expect) Object(value map[string]interface{}) *Object {
	return NewObject(e.config.Reporter, value)
}
693340
func Fail(resultType reflect.Type) gopter.Gen {
	return func(*gopter.GenParameters) *gopter.GenResult {
		return gopter.NewEmptyResult(resultType)
	}
}
561876
func (c *Call) Return(returnArguments ...interface{}) *Call {
	c.lock()
	defer c.unlock()

	c.ReturnArguments = returnArguments

	return c
}
596175
func (as ArraySpec) Rand() Input {
	return as.proc(func(i Input) Input {
		return i.Rand()
	})
}
287938
func (r *MockResult) Error(i int) error {
	if r.Contains(i) && r.Result[i] != nil {
		return r.Result[i].(error)
	} else {
		return nil
	}
}
1217928
func (m *MockIndex) Func(arg0 func(http.Request) (int, bool)) {
	m.ctrl.T.Helper()
	m.ctrl.Call(m, "Func", arg0)
}
617777
func (p *Parser) expect(llk *LLk, st *semantic.Statement, s semantic.Symbol, cls *Clause) (bool, error) {
	if cls.ProcessStart != nil {
		if _, err := cls.ProcessStart(st, s); err != nil {
			return false, err
		}
	}
	for _, elem := range cls.Elements {
		tkn := llk.Current()
		if elem.isSymbol {
			if b, err := p.consume(llk, st, elem.Symbol()); !b || err != nil {
				return false, fmt.Errorf("Parser.parse: Failed to consume symbol %v, with error %v", elem.Symbol(), err)
			}
		} else {
			if !llk.Consume(elem.Token()) {
				return false, fmt.Errorf("Parser.parse: Failed to consume %s, got %s instead", elem.Token(), llk.Current().Type)
			}
		}
		if cls.ProcessedElement != nil {
			var ce semantic.ConsumedElement
			if elem.isSymbol {
				ce = semantic.NewConsumedSymbol(elem.Symbol())
			} else {
				ce = semantic.NewConsumedToken(tkn)
			}
			if _, err := cls.ProcessedElement(st, ce); err != nil {
				return false, err
			}
		}
	}
	if cls.ProcessEnd != nil {
		if _, err := cls.ProcessEnd(st, s); err != nil {
			return false, err
		}
	}
	return true, nil
}
794828
func (mr *MockProviderMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockProvider)(nil).Get), arg0, arg1)
}
779298
func (F *Frisby) Expect(foo ExpectFunc) *Frisby {
	Global.NumAsserts++
	if ok, err_str := foo(F); !ok {
		F.AddError(err_str)
	}
	return F
}
1020061
func (r *MockResult) String(i int) string {
	if r.Contains(i) {
		return r.Result[i].(string)
	} else {
		return ""
	}
}
983905
func (pool *connPool) Return(conn net.Conn) {
	pool.mu.Lock()
	defer pool.mu.Unlock()
	atomic.AddInt64(&pool.stats.returnedConnections, 1)
	pool.conns = append(pool.conns, conn)
}
911091
func (m *MockStorage) Get(arg0 string) (io.ReadCloser, int64, error) {
	ret := m.ctrl.Call(m, "Get", arg0)
	ret0, _ := ret[0].(io.ReadCloser)
	ret1, _ := ret[1].(int64)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}
950512
func Return() HandlerFunc {
	return func(ctx *Context) {
		var rt int
		action := ctx.Action()
		if action != nil {
			if i, ok := action.(ResponseTyper); ok {
				rt = i.ResponseType()
			}
		}

		ctx.Next()

		// if no route match or has been write, then return
		if action == nil || ctx.Written() {
			return
		}

		// if there is no return value or return nil
		if isNil(ctx.Result) {
			// then we return blank page
			ctx.Result = ""
		}

		var result = ctx.Result
		var statusCode = 0
		if res, ok := ctx.Result.(*StatusResult); ok {
			statusCode = res.Code
			result = res.Result
		}

		if rt == jsonResponse {
			encoder := json.NewEncoder(ctx)
			if len(ctx.Header().Get("Content-Type")) <= 0 {
				ctx.Header().Set("Content-Type", "application/json; charset=UTF-8")
			}

			switch res := result.(type) {
			case AbortError:
				if statusCode == 0 {
					statusCode = res.Code()
				}
				ctx.WriteHeader(statusCode)
				encoder.Encode(map[string]string{
					"err": res.Error(),
				})
			case ErrorWithCode:
				if statusCode == 0 {
					statusCode = http.StatusOK
				}
				ctx.WriteHeader(statusCode)
				encoder.Encode(map[string]interface{}{
					"err":      res.Error(),
					"err_code": res.ErrorCode(),
				})
			case error:
				if statusCode == 0 {
					statusCode = http.StatusOK
				}
				ctx.WriteHeader(statusCode)
				encoder.Encode(map[string]string{
					"err": res.Error(),
				})
			case string:
				if statusCode == 0 {
					statusCode = http.StatusOK
				}
				ctx.WriteHeader(statusCode)
				encoder.Encode(map[string]string{
					"content": res,
				})
			case []byte:
				if statusCode == 0 {
					statusCode = http.StatusOK
				}
				ctx.WriteHeader(statusCode)
				encoder.Encode(map[string]string{
					"content": string(res),
				})
			default:
				if statusCode == 0 {
					statusCode = http.StatusOK
				}
				ctx.WriteHeader(statusCode)
				err := encoder.Encode(result)
				if err != nil {
					ctx.Result = err
					encoder.Encode(map[string]string{
						"err": err.Error(),
					})
				}
			}

			return
		} else if rt == xmlResponse {
			encoder := xml.NewEncoder(ctx)
			if len(ctx.Header().Get("Content-Type")) <= 0 {
				ctx.Header().Set("Content-Type", "application/xml; charset=UTF-8")
			}
			switch res := result.(type) {
			case AbortError:
				if statusCode == 0 {
					statusCode = res.Code()
				}
				ctx.WriteHeader(statusCode)
				encoder.Encode(XMLError{
					Content: res.Error(),
				})
			case error:
				if statusCode == 0 {
					statusCode = http.StatusOK
				}
				ctx.WriteHeader(statusCode)
				encoder.Encode(XMLError{
					Content: res.Error(),
				})
			case string:
				if statusCode == 0 {
					statusCode = http.StatusOK
				}
				ctx.WriteHeader(statusCode)
				encoder.Encode(XMLString{
					Content: res,
				})
			case []byte:
				if statusCode == 0 {
					statusCode = http.StatusOK
				}
				ctx.WriteHeader(statusCode)
				encoder.Encode(XMLString{
					Content: string(res),
				})
			default:
				if statusCode == 0 {
					statusCode = http.StatusOK
				}
				ctx.WriteHeader(statusCode)
				err := encoder.Encode(result)
				if err != nil {
					ctx.Result = err
					encoder.Encode(XMLError{
						Content: err.Error(),
					})
				}
			}
			return
		}

		switch res := result.(type) {
		case AbortError, error:
			ctx.HandleError()
		case []byte:
			if statusCode == 0 {
				statusCode = http.StatusOK
			}
			ctx.WriteHeader(statusCode)
			ctx.Write(res)
		case string:
			if statusCode == 0 {
				statusCode = http.StatusOK
			}
			ctx.WriteHeader(statusCode)
			ctx.WriteString(res)
		}
	}
}
555462
func (b *InsertStmt) Returning(column ...string) *InsertStmt {
	b.ReturnColumn = column
	return b
}