Go String after variable declaration

前端 未结 2 739
庸人自扰
庸人自扰 2021-01-21 01:55

Take a look at this snip found at here

import (
    \"encoding/xml\"
    \"fmt\"
    \"os\"
)

func main() {
    type Address struct {
        City, State string
             


        
2条回答
  •  旧巷少年郎
    2021-01-21 02:30

    It's a struct tag. Libraries use these to annotate struct fields with extra information; in this case, the module encoding/xml uses these struct tags to denote which tags correspond to the struct fields.

提交回复
热议问题