官术网_书友最值得收藏!

Printing output

The simplest way to print something in Go is using the fmt.Println() and fmt.Printf() functions. The fmt.Printf() function has many similarities with the C printf(3) function. You can also use the fmt.Print() function instead of fmt.Println().

The main difference between fmt.Print() and fmt.Println() is that the latter automatically prints a newline character each time you call it. The biggest difference between fmt.Println() and fmt.Printf() is that the latter requires a format specifier for everything it will print, just like the C printf(3) function. This means that you have better control over what you are doing, but you have to write more code. Go calls these specifiers verbs, and you can find out more about supported verbs at https://golang.org/pkg/fmt/.

主站蜘蛛池模板: 磴口县| 威信县| 东阳市| 思南县| 泗阳县| 营口市| 广河县| 泗水县| 方山县| 隆德县| 云梦县| 定州市| 岳阳市| 中阳县| 南京市| 塔城市| 富裕县| 益阳市| 武胜县| 邯郸市| 海林市| 神农架林区| 松桃| 根河市| 德安县| 汉川市| 日喀则市| 鄂托克旗| 萨迦县| 开平市| 桂阳县| 邹平县| 十堰市| 合山市| 营山县| 融水| 昌平区| 龙里县| 邛崃市| 罗田县| 抚顺县|