Go generics and changes in v1.18 (#5)

* ArrayIn to use generics.

* interface{} -> any.
This commit is contained in:
Miroslav Šedivý
2022-07-28 12:20:20 +02:00
committed by GitHub
parent c725e96c90
commit babddacbf3
26 changed files with 100 additions and 110 deletions

View File

@ -79,14 +79,14 @@ type VideoConfig struct {
}
func (config *VideoConfig) GetPipeline(screen ScreenSize) (string, error) {
values := map[string]interface{}{
values := map[string]any{
"width": screen.Width,
"height": screen.Height,
"fps": screen.Rate,
}
language := []gval.Language{
gval.Function("round", func(args ...interface{}) (interface{}, error) {
gval.Function("round", func(args ...any) (any, error) {
return (int)(math.Round(args[0].(float64))), nil
}),
}