go怎么给反引号中的某个变量传参?

这里怎么给username 和password传参 ,请求大神指教~谢谢 reqBody := <?xml version="1.0" encoding="utf-8"?>

username password
已邀请:

yet

赞同来自:

没太看懂问题

killernova - Ruby 工程师,Go 爱好者

赞同来自:

是说的是类似ruby的插值吗?

name = 'Li Ming'
text = "My name is #{name}, who are you?"
# text = "My name is Li Ming, who are you?"

如果是这种,就用 Sprintf

name := "Li Ming"
text := fmt.Sprintf(`my name is %s, who are you?`, name)

想github登录

赞同来自:

二楼太热情了

要回复问题请先登录注册