GoVar returns the Go code that returns the address of a variable of the Go type which matches the given attribute type.
(varName string, dt expr.DataType)
| 243 | // GoVar returns the Go code that returns the address of a variable of the Go type |
| 244 | // which matches the given attribute type. |
| 245 | func (*NameScope) GoVar(varName string, dt expr.DataType) string { |
| 246 | // For a raw struct, no need to indirecting |
| 247 | if isRawStruct(dt) { |
| 248 | return varName |
| 249 | } |
| 250 | return "&" + varName |
| 251 | } |
| 252 | |
| 253 | // GoTypeRef returns the Go code that refers to the Go type which matches the |
| 254 | // given attribute type. |
no test coverage detected