解答
- https://programnotes.cn/golang-1000-question-answer/
- code,repo in github <git@github.com:yiGmMk/golang-1000-question.git>
- 代码允许环境:
- go version go1.15.3 linux/amd64
const
[001]iota,有常量如下,second数值是?
1
2
3
4
5
6const (
first = 1
second =iota
third
fourth
)
string
[002]strings.ReplaceAll,代码如下,replace的值是?
1
2
3
4origin := " 特斯拉Model X "
replace := strings.ReplaceAll(origin, " ", "")
fmt.Printf("origin:%s\nreplace:%s\n", origin, replace)