-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
I'm trying to load a sample pkl file using the following code. I'm on go 1.24.2. I get back this error on Windows, but it succeeds on WSL. The versions are Pkl 0.28.1 (Linux 5.15.0-1064-aws, native) & Pkl 0.28.1 (Windows 10.0, native) & github.com/apple/pkl-go v0.10.0
go run main.go
panic: org.pkl.core.PklBugException: An unexpected error has occurred. Would you mind filing a bug report?
Input: foo.pkl
keys {
["g"] {
url = "https://google.com"
keys {
["apple"] {
url = "https://google.com/search?q=apple"
}
}
}
}Program: main.go
package main
import (
"context"
"fmt"
"github.com/apple/pkl-go/pkl"
)
type Query struct {
Url *string `pkl:"url"`
Keys *map[string]*Query `pkl:"keys"`
}
type QueryConfig struct {
Keys map[string]*Query `pkl:"keys"`
}
func main() {
evaluator, err := pkl.NewEvaluator(context.Background(), pkl.PreconfiguredOptions)
if err != nil {
panic(err)
}
defer evaluator.Close()
var cfg QueryConfig
if err = evaluator.EvaluateModule(context.Background(), pkl.FileSource("foo.pkl"), &cfg); err != nil {
panic(err)
}
fmt.Printf("Got module: %+v", cfg)
}xederro
Metadata
Metadata
Assignees
Labels
No labels