1 Star 0 Fork 0

timesp/go-git

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.travis
clients
config
core
cshared
diff
examples
fixtures
formats
config
idxfile
index
objfile
packfile
decoder.go
decoder_test.go
delta.go
doc.go
error.go
scanner.go
scanner_test.go
packp
storage
utils
.gitignore
.travis.yml
LICENSE
Makefile
README.md
blame.go
blame_test.go
blobs.go
blobs_test.go
commit.go
commit_test.go
commit_walker.go
commit_walker_test.go
common.go
common_test.go
doc.go
file.go
file_test.go
objects.go
objects_test.go
options.go
references.go
references_test.go
remote.go
remote_test.go
repository.go
repository_test.go
tag.go
tag_test.go
tree.go
tree_diff.go
tree_diff_test.go
tree_test.go
克隆/下载
error.go 645 Bytes
一键复制 编辑 原始数据 按行查看 历史
package packfile
import "fmt"
// Error specifies errors returned during packfile parsing.
type Error struct {
reason, details string
}
// NewError returns a new error.
func NewError(reason string) *Error {
return &Error{reason: reason}
}
// Error returns a text representation of the error.
func (e *Error) Error() string {
if e.details == "" {
return e.reason
}
return fmt.Sprintf("%s: %s", e.reason, e.details)
}
// AddDetails adds details to an error, with additional text.
func (e *Error) AddDetails(format string, args ...interface{}) *Error {
return &Error{
reason: e.reason,
details: fmt.Sprintf(format, args...),
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/timesp/go-git.git
git@gitee.com:timesp/go-git.git
timesp
go-git
go-git
v4.0.0-rc3

搜索帮助