计轴rssp 集成

This commit is contained in:
xzb 2023-11-07 13:22:31 +08:00
parent 8b25469d6e
commit 953bab8063

View File

@ -18,6 +18,10 @@ func NewOkResult[T any](val T) Result[T] {
return Result[T]{Val: val, Err: nil} return Result[T]{Val: val, Err: nil}
} }
func NewResult[T any](val T, err error) Result[T] {
return Result[T]{Val: val, Err: err}
}
// 新建一个错误结果 // 新建一个错误结果
func NewErrResult(err error) Result[EmptyType] { func NewErrResult(err error) Result[EmptyType] {
return Result[EmptyType]{Val: struct{}{}, Err: err} return Result[EmptyType]{Val: struct{}{}, Err: err}