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

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

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

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

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

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