我正在閱讀日志源代碼,我在這里很困惑:// SetOutput sets the output destination for the standard logger.func SetOutput(w io.Writer) { std.mu.Lock() defer std.mu.Unlock() std.out = w}// Flags returns the output flags for the standard logger.func Flags() int { return std.Flags()}// SetFlags sets the output flags for the standard logger.func SetFlags(flag int) { std.SetFlags(flag)}為什么SetOutPut用mu鎖而SetFlags不用mu鎖?
1 回答

慕碼人8056858
TA貢獻1803條經(jīng)驗 獲得超6個贊
- 1 回答
- 0 關(guān)注
- 195 瀏覽
添加回答
舉報
0/150
提交
取消