github.com/tencent/goom@v1.0.1/erro/ret_param_not_found.go (about)

     1  package erro
     2  
     3  import "strconv"
     4  
     5  // ReturnParamNotFound 返回值未找到异常
     6  type ReturnParamNotFound struct {
     7  	funcName string
     8  	arg      int
     9  }
    10  
    11  // Error 返回错误字符串
    12  func (e *ReturnParamNotFound) Error() string {
    13  	return "arg not found: " + e.funcName + ":" + strconv.Itoa(e.arg)
    14  }
    15  
    16  // NewReturnParamNotFoundError 函数未找到
    17  // funcName 函数名称
    18  // index 返回值下标
    19  func NewReturnParamNotFoundError(funcName string, index int) error {
    20  	return &ArgNotFound{funcName: funcName, arg: index}
    21  }