1 Star 0 Fork 0

liboxwz/dep

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
error.go 690 Bytes
一键复制 编辑 原始数据 按行查看 历史
// Copyright 2017 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.
package gps
import (
"bytes"
"fmt"
)
type errorSlice []error
func (errs errorSlice) Error() string {
var buf bytes.Buffer
fmt.Fprintln(&buf)
for i, err := range errs {
fmt.Fprintf(&buf, "\t(%d) %s\n", i+1, err)
}
return buf.String()
}
func (errs errorSlice) Format(f fmt.State, c rune) {
fmt.Fprintln(f)
for i, err := range errs {
if ferr, ok := err.(fmt.Formatter); ok {
fmt.Fprintf(f, "\t(%d) ", i+1)
ferr.Format(f, c)
fmt.Fprint(f, "\n")
} else {
fmt.Fprintf(f, "\t(%d) %s\n", i+1, err)
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liboxwz/dep.git
git@gitee.com:liboxwz/dep.git
liboxwz
dep
dep
v0.5.3

搜索帮助