fmt.print参数规约
printf输出规约是按照预定义好的参数格式输出的,参数和对应说明如下表所示。
| parameter | description |
|---|---|
| %d | decimal integer |
| %x, %o, %b | integer in hexade cimal, octal, binar y |
| %f, %g, %e | floating-p oint number: 3.141593 3.141592653589793 3.141593e+00 |
| %t | boole an: true or false |
| %c | rune (Unico de co de point) |
| %s | string |
| %q | quoted str ing “abc” or rune ‘c’ |
| %v | any value in a natural format |
| %T | type of any value |
| %% | literal percent sig n (no operand) |
@author weixin public account
本文详细介绍了fmt.print家族中printf的参数规约,包括整数、浮点数、布尔值等不同类型数据的输出格式,为开发者提供了一份实用的指南。

909

被折叠的 条评论
为什么被折叠?



