update update contents

This commit is contained in:
Edward 2020-05-14 23:35:44 +08:00
parent 94b8f71cc6
commit 78ae8f6954
2 changed files with 12 additions and 1 deletions

View File

@ -47,6 +47,7 @@
}, },
"fileheader.Author":"Edward", "fileheader.Author":"Edward",
"fileheader.tpl": "/*\r\n * @Description: https://github.com/crazybber\r\n * @Author: {author}\r\n * @Date: {createTime}\r\n * @Last Modified by: {lastModifiedBy}\r\n * @Last Modified time: {updateTime}\r\n */\r\n\r\n", "fileheader.tpl": "/*\r\n * @Description: https://github.com/crazybber\r\n * @Author: {author}\r\n * @Date: {createTime}\r\n * @Last Modified by: {lastModifiedBy}\r\n * @Last Modified time: {updateTime}\r\n */\r\n\r\n",
"fileheader.LastModifiedBy": "Edward" "fileheader.LastModifiedBy": "Edward",
"peacock.color": "#5e7959"
} }
//https://vscode.readthedocs.io/en/latest/getstarted/settings/ //https://vscode.readthedocs.io/en/latest/getstarted/settings/

View File

@ -70,6 +70,16 @@ func NewRequestBreaker(opts ...Option) *RequestBreaker {
} }
} }
// Do runs the given request if the RequestBreaker accepts it.
// Do returns an error instantly if the RequestBreaker rejects the request.
// Otherwise, Execute returns the result of the request.
// If a panic occurs in the request, the RequestBreaker handles it as an error and causes the same panic again.
func (rb *RequestBreaker) Do(req func() (interface{}, error)) (interface{}, error) {
result, err := req()
return result, err
}
//State of current switch //State of current switch
type State int type State int