I was digging in AWS SDK source codes and came across with the following type declaration:
type Condition struct {
_ struct{} `type:"structure"`
// the rest of code is removed
}
Do anybody know purpose/explanation of this kind of embedding?
Its been used for code generation perposes. you can think of it like java which treats everything in it as an object.
example of using it is here
{{ $shapeList := ShapeListWithErrors $ }}
{{ range $_, $s := $shapeList }}
{{ if eq $s.Type "structure"}}{{ $s.GoCode }}{{ end }}
{{ end }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With