This question already has an answer here:
https://github.com/golang/xerrors/blob/master/fmt_test.go#L379
var _ xerrors.Formatter = wrapped{}
var _ xerrors.Formatter = detailed{}
What is the purpose of this two lines?
</div>
This question already has an answer here:
https://github.com/golang/xerrors/blob/master/fmt_test.go#L379
var _ xerrors.Formatter = wrapped{}
var _ xerrors.Formatter = detailed{}
What is the purpose of this two lines?
</div>
收起
https://github.com/golang/xerrors
This repository holds the transition packages for the new Go 1.13 error values.
Look at the Go source tip for the actual implementation for Go1.13.
https://go.googlesource.com/go
Compile time checks that they satisfy xerrors.Formatter
.
var _ xerrors.Formatter = wrapped{}
var _ xerrors.Formatter = detailed{}
报告相同问题?