编程笔记

lifelong learning & practice makes perfect

Go语言一千问

解答

  1. https://programnotes.cn/golang-1000-question-answer/
  2. code,repo in github <git@github.com:yiGmMk/golang-1000-question.git>
  3. 代码允许环境:
    • go version go1.15.3 linux/amd64

const

  1. [001]iota,有常量如下,second数值是?

    1
    2
    3
    4
    5
    6
    const (
    first = 1
    second =iota
    third
    fourth
    )

string

  1. [002]strings.ReplaceAll,代码如下,replace的值是?

    1
    2
    3
    4
    origin := "   特斯拉Model X    "
    replace := strings.ReplaceAll(origin, " ", "")

    fmt.Printf("origin:%s\nreplace:%s\n", origin, replace)

欢迎关注我的其它发布渠道