• 请不要在回答技术问题时复制粘贴 AI 生成的内容
chy373180
V2EX  ›  程序员

大家怎么处理 golang gorountine 内的 error 呢,分享一下

  •  
  •   chy373180 · Jun 13, 2017 · 2152 views
    This topic created in 3280 days ago, the information mentioned may be changed or developed.

    google 了下常用的方法是建一个 error channel 来接收错误信息,有其他思路么

    4 replies    2017-06-13 21:47:08 +08:00
    wangxn
        1
    wangxn  
       Jun 13, 2017 via Android
    直接 log.Print()
    bigpigeon
        2
    bigpigeon  
       Jun 13, 2017
    可以用 log 打印,也可以弄一个全局 channel 传递 error 集中打印
    HarrisonZ
        3
    HarrisonZ  
       Jun 13, 2017
    直接 log print 出来
    cloverstd
        4
    cloverstd  
       Jun 13, 2017
    log 打印

    如果跟其他地方有通信,就用 channel
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2891 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 05:29 · PVG 13:29 · LAX 22:29 · JFK 01:29
    ♥ Do have faith in what you're doing.