(enc *encoder, count uint64, dst fastJsonNode)
| 1276 | } |
| 1277 | |
| 1278 | func (sg *SubGraph) addCount(enc *encoder, count uint64, dst fastJsonNode) error { |
| 1279 | if sg.Params.Normalize && sg.Params.Alias == "" { |
| 1280 | return nil |
| 1281 | } |
| 1282 | c := types.ValueForType(types.IntID) |
| 1283 | c.Value = int64(count) |
| 1284 | fieldName := sg.Params.Alias |
| 1285 | if fieldName == "" { |
| 1286 | fieldName = fmt.Sprintf("count(%s)", sg.Attr) |
| 1287 | } |
| 1288 | return enc.AddValue(dst, enc.idForAttr(fieldName), c) |
| 1289 | } |
| 1290 | |
| 1291 | func (sg *SubGraph) aggWithVarFieldName() string { |
| 1292 | if sg.Params.Alias != "" { |
no test coverage detected