我正着用我用的方法打印它string,uint但是没有效果strconv方法组合。 0 m9 C, p) w ~) Z# ], J; I% a
log.Println("The amount is: " strconv.Itoa((charge.Amount))) & |8 E3 \1 v# n, L
给我:# d0 o2 e" t; L6 p- {6 f
cannot use charge.Amount (type uint64) as type int in argument to strconv.Itoa我怎样才能打印这个?string?. [' [- R( A4 A8 J
- _$ d' e1 r% n6 f 解决方案: 6 i/ c/ {+ {, I7 M
strconv.Itoa()需要一个 type 值int,所以你必须给它: + z' Q# Y9 i& F5 z8 T' E- V# h3 s
log.Println("The amount is: " strconv.Itoa(int(charge.Amount))) " |4 {# G$ l( C9 k, d, Y