V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
douglarek

Go errors 堆栈

  •  
  •   douglarek ·
    douglarek · Apr 12, 2018 · 1768 views
    This topic created in 2936 days ago, the information mentioned may be changed or developed.
    3 replies    2018-04-16 17:21:11 +08:00
    douglarek
        1
    douglarek  
    OP
       Apr 12, 2018
    国际惯例,自沙
    suyuanhxx
        2
    suyuanhxx  
       Apr 12, 2018
    描述太少了
    freestyle
        3
    freestyle  
       Apr 16, 2018
    我也和楼主一样在这方面深入思考过, pkg/errors 每次 wrap 都会调用 runtime.Callers, 消耗较大, 其实可以在最底层抛 error 的时候就拿到所有的调用栈信息, 这样只调用一次 runtime.Callers 就可以了的 https://github.com/hanjm/errors
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   853 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 21:54 · PVG 05:54 · LAX 14:54 · JFK 17:54
    ♥ Do have faith in what you're doing.