doulun0651 2019-04-27 18:54
浏览 13
已采纳

var _ xerrors.Formatter =包装{} [重复]

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>
  • 写回答

1条回答 默认 最新

  • douchushao7799 2019-04-27 19:00
    关注

    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{}
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部