- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 463
Closed
Description
Hi, thank you for your time and for reading. I'm trying to slice an array passed in the environment but I'm getting a runtime error reflect.Value.Slice: slice of unaddressable array. Example (Go Playground):
prog, err := expr.Compile(`arr[1:2]`)
if err != nil {
	panic(err)
}
val, err := expr.Run(prog, map[string]any{
	"arr": [5]int{0, 1, 2, 3, 4},
})
if err != nil {
	panic(err)
}
fmt.Println("Result:", val)I also tried to pass &[5]int{0, 1, 2, 3, 4} instead but didn't work either.
EDIT: I made a PR with a fix, but let me know if it's appropriate or if you would rather discuss a better approach instead.
Metadata
Metadata
Assignees
Labels
No labels