Codegen: Generate Golang code using cog (#98812)

* Use cog for Go types

* Delete old generation code

* Fix plugins generation

* workspaces update

* Update datasources with new generated code

* More fixes

* Update swagger and openapi specs

* Fixes

* More files...

* Update workspace

* More fixes...

* Remove unused functions
This commit is contained in:
Selene
2025-01-14 15:58:38 +01:00
committed by GitHub
parent b96a752db3
commit 7151ea6abc
58 changed files with 4910 additions and 4202 deletions
+1 -10
View File
@@ -154,7 +154,7 @@ func parseQuery(queryContext *backend.QueryDataRequest, logqlScopesEnabled bool)
return nil, err
}
expr := interpolateVariables(depointerizer(model.Expr), interval, timeRange, queryType, step)
expr := interpolateVariables(model.Expr, interval, timeRange, queryType, step)
direction, err := parseDirection(model.Direction)
if err != nil {
@@ -197,12 +197,3 @@ func parseQuery(queryContext *backend.QueryDataRequest, logqlScopesEnabled bool)
return qs, nil
}
func depointerizer[T any](v *T) T {
var emptyValue T
if v != nil {
emptyValue = *v
}
return emptyValue
}