是否可以像代码中那样对单个标签使用多个标签值

type XMLStruct struct {
    Name    string  `json:"name" json:"FirstName"`
    Date    string  `xml:"Date" xml:"pudDate"`
}

I am going to say no not in this way.

you can do this,

type XMLStruct struct {
    Name    string  `json:"name" xml:"name"`
    Date    string  `json:"Date" xml:"Date"`
}

or this,

type XMLStruct struct {
    Name        string  `json:"name, omitempty" xml:"name, omitempty"`
    Date        string  `json:"Date, omitempty" xml:"Date, omitempty"`
    FirstName   string  `json:"FirstName, omitempty" xml:"FirstName, omitempty"`
}

But I don't believe that you can map multiple json names to one struct field and I think that the reason for this would be is what if they both existed in the json structure, which one do you retain and throw away etc.

If you have the same key in key:"value" pair, struct tag look up will only use the first value you specific.

So, Your struct will look like

type XMLStruct struct {
    Name    string  `json:"name"`
    Date    string  `xml:"Date"`
}

You can read some information in reflect package StructTag

The field tag of a go-struct can literally have any UTF-8 sequence. This is legal go-code:

type XMLStruct struct {
    Name string `g1bb3ri$h...T@g`
}

So tags are up for interpretation. The json package in the standard library expects tags in a particular format - which maps a single struct field to a single JSON attribute.

If you wanted to support multiple attributes for a single field - one could write their own Marshal/Unmarshal and act on this new tag format. But as some of the other comments/answers have suggested, there is the dilemma of handling conflicts.

There's no definitive answer to this. Struct tags, at the language spec level, are arbitrary text, with no inherent meaning. See the spec. This means that, from a language standpoint, json:"name" json:"FirstName" is a valid tag, as is any other arbitrary text.

What matters is how code interprets the tags. Since you're talking about the json tag, you probably care about the encoding/json package in the standard library. How this package interprets tags is described in the documentation here and here. A duplicate tag like this would, at best, be ambiguous, so one could say it's not supported. Although using such a tag will do something. What it does may or may not align with what you expect (depending on what you expect).

But there can be other packages that interpret json tags--possibly including one you write yourself. And they can use whatever rules they want, including either permitting or prohibiting multiple tag segments with the same name.