如何使用 fmt.Printl 在 Go 中打印变量值?
how print variable values in Go with fmt.Printl?
我有以下代码片段:
x_variable := 12311
fmt.Println("message", "X variable has the value '+x_variable+' printed in the screen now")
我怎样才能做到这一点?
我已经在 Go playground 中尝试过,但无法弄清楚如何正确打印 vaue。
我有以下代码片段:
x_variable := 12311
fmt.Println("message", "X variable has the value '+x_variable+' printed in the screen now")
我怎样才能做到这一点? 我已经在 Go playground 中尝试过,但无法弄清楚如何正确打印 vaue。