我看 go 的 fmt 包中没有输出到标准错误输出的库函数,是没有相关的库函数吗?
答案是:fmt.Fprint(os.Stderr, "to stderr\n")fmt.Fprintf(os.Stderr, "v=%v\n", "to stderr")
吐槽:为什么 CSDN 的问答不能进行自我回答呢?
fmt.Errorf()不可以吗