You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Host represents a computer, a VM or a similar systemtypeHoststruct {
Namestring`json:"hostname"`Domainstring`json:"domain"`Loginstring`json:"login"`Contactstring`json:"contact"`CPUCoresuint`json:"sp_number_processors"`CPUSpeedstring`json:"sp_current_processor_speed"`Memorystring`json:"memorysize_mb"`FacterVersionstring`json:"facterversion"`Kernelstring`json:"kernelrelease"`Releasestring`json:"operatingsystem"`Serialstring`json:"serialnumber"`IsVirtualbool`json:"is_virtual"`Disks []Disk`json:"omitempty"`ChildVMs []Host`json:"omitempty"`
}
Then save, which will trigger go tool vet on the file. The last line (ChildVMs...) will then be highlighted with a curly green line, indicating a warning, saying it has a duplicate tag that's already defined.
What did you expect to see?
No curly green line on the last field definition since it should be OK to have multiple lines with that tag.
Over at the repository for the Go-VSCode plugin I posted a screenshot.
The text was updated successfully, but these errors were encountered:
ALTree
changed the title
go tool vet gives warning with json:"omitempty" field tag
cmd/vet: warning with duplicate json:"omitempty" field tag
Nov 6, 2017
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
Write the following code in VSCode:
Then save, which will trigger
go tool vet
on the file. The last line (ChildVMs...) will then be highlighted with a curly green line, indicating a warning, saying it has a duplicate tag that's already defined.What did you expect to see?
No curly green line on the last field definition since it should be OK to have multiple lines with that tag.
Over at the repository for the Go-VSCode plugin I posted a screenshot.
The text was updated successfully, but these errors were encountered: