yeebing
yeebing
使用下来发现日志包可以扩展的几个点: 1.日志包在输出到不同的地方的时候可以采用不同的writer,写到 stdout 的日志可以正常显示颜色,但是写到文本文件里的日志就不能。 我觉得可以用 zap 的tee来拼接多个core实现。 2. 现在的日志我没有找到日志分割的接口,因为是用build来创建 zap 的而不是用 zap.New 的core 来创建的,可以增加适当接口。 3. 对于日期这类我觉得也可以对外提供可选择的接口。
When I was fixing a bug, I encountered the problem that the code could not be pushed to the remote repository. ```shell error: src refspec main does not match any...
https://github.com/marmotedu/iam/blob/f39d4105e563c01fb4869bbaf1b19f5afa944400/internal/apiserver/service/v1/user.go#L44-L111 I think the design of this function errChan will have potential coroutine blocking problems, which will lead to coroutine leaks. If more than one goroutine encounters an error, all...
have read the source code of go-zero regarding graceful shutdown. And this is my [blog](https://www.yeebing.cn/2023/03/09/go/%E4%BC%98%E9%9B%85%E5%85%B3%E9%97%AD/#more) summary of go-zero's graceful shutdown feature. https://github.com/zeromicro/go-zero/blob/fafbee24b891f6c6450b6ecbe2ba5ea19b99daf9/core/proc/shutdown.go#L1-L100 I think that the design of two staggered...
https://github.com/mosn/pkg/blob/e3528eae50d92595b3ea1e5bf75fa4f6aff9c43e/utils/goroutine.go#L41-L60 这里的 GoWithRecover 是不是拆成两个函数比较好,我在使用 errgroup 需要传入裸函数,这样拆分可以使用到 recover 机制,同时是否开启 goroutine 交给用户决定。 ```go func GoWithRecover(handler func(), recoverHandler func(r interface{})) { go func() { WithRecover(handler, recoverHandler) }() } func WithRecover(handler func(), recoverHandler func(r...