Go String after variable declaration

前端 未结 2 760
庸人自扰
庸人自扰 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:41

    which mean that variable will present in the name of Person example

    type sample struct {
         dateofbirth string `xml:"dob"`
    }
    
    In the above example, the field 'dateofbirth' will present in the name of 'dob' in the XML.
    

    you will see this notation often in go struct.

提交回复
热议问题