mirror of
https://github.com/astaxie/beego.git
synced 2025-07-06 13:40:18 +00:00
only add golang.org vendor
This commit is contained in:
31
vendor/github.com/wendal/errors/README.md
generated
vendored
31
vendor/github.com/wendal/errors/README.md
generated
vendored
@ -1,31 +0,0 @@
|
||||
errors
|
||||
======
|
||||
|
||||
增强型errors包(for golang)
|
||||
--------------------------
|
||||
|
||||
完全兼容官方的errors包,且附带堆栈信息,方便debug
|
||||
----------------------------------------------
|
||||
|
||||
API完全兼容
|
||||
|
||||
安装
|
||||
----
|
||||
|
||||
```
|
||||
go get github.com/wendal/errors
|
||||
```
|
||||
|
||||
使用
|
||||
----
|
||||
|
||||
仅需将
|
||||
```
|
||||
import errors
|
||||
```
|
||||
|
||||
改为
|
||||
```
|
||||
import github.com/wendal/errors
|
||||
```
|
||||
|
30
vendor/github.com/wendal/errors/errors.go
generated
vendored
30
vendor/github.com/wendal/errors/errors.go
generated
vendored
@ -1,30 +0,0 @@
|
||||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// And Modify By Wendal (wendal1985@gmail.com)
|
||||
|
||||
// Package errors implements functions to manipulate errors.
|
||||
package errors
|
||||
|
||||
import (
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
var AddStack = true
|
||||
|
||||
// New returns an error that formats as the given text.
|
||||
func New(text string) error {
|
||||
if AddStack {
|
||||
text += "\n" + string(debug.Stack())
|
||||
}
|
||||
return &errorString{text}
|
||||
}
|
||||
|
||||
// errorString is a trivial implementation of error.
|
||||
type errorString struct {
|
||||
s string
|
||||
}
|
||||
|
||||
func (e *errorString) Error() string {
|
||||
return e.s
|
||||
}
|
Reference in New Issue
Block a user