gobyexample/examples/string-formatting/string-formatting.sh
2021-09-05 23:08:37 +03:00

25 lines
443 B
Bash

$ go run string-formatting.go
struct1: {1 2}
struct2: {x:1 y:2}
struct3: main.point{x:1, y:2}
type: main.point
bool: true
int1: 123
int2: | 12| 345|
bin: 1110
char: !
hex: 1c8
float1: 78.900000
float2: 1.234000e+08
float3: 1.234000E+08
float4: |1.20 |3.45 |
float5: | 1.20| 3.45|
str1: "string"
str2: "\"string\""
str3: 6865782074686973
str4: |foo |b |
str5: | foo| b|
sprintf: a string
pointer: 0xc420014090
io: an error