GoExpertProgramming icon indicating copy to clipboard operation
GoExpertProgramming copied to clipboard

格式化输入输出素材收集

Open RainbowMango opened this issue 4 years ago • 1 comments

本issue用于收集、记录格式化输入输出方面的知识。

RainbowMango avatar Mar 28 '20 03:03 RainbowMango

内置函数println和print会将结果打印到标准错误中,这就决定了它不能用于Example测试中:

// The print built-in function formats its arguments in an
// implementation-specific way and writes the result to standard error.
// Print is useful for bootstrapping and debugging; it is not guaranteed
// to stay in the language.
func print(args ...Type)

// The println built-in function formats its arguments in an
// implementation-specific way and writes the result to standard error.
// Spaces are always added between arguments and a newline is appended.
// Println is useful for bootstrapping and debugging; it is not guaranteed
// to stay in the language.
func println(args ...Type)

RainbowMango avatar Mar 28 '20 03:03 RainbowMango