mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
When calling a function, if the input param is a "zero" instance, it is not set on the input. This is an issue where the param is an `interface{}` as a `nil` value is set instead of the zero value.
The actual solution for this is to remove the `if !val.IsZero()`, this however runs into an issue on `_test/struct48.go` where we have a zero recursive struct instance (`*interface{}`) and we have no way to get its real type. Should a way be figured out to keep tabs on the original type, the `if` can go away, and in the zero case of `genValueRecursiveInterfacePtrValue`, the actual zero type can be returned.
Fixes #1215
21 lines
163 B
Go
21 lines
163 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type data struct {
|
|
S string
|
|
}
|
|
|
|
func render(v interface{}) {
|
|
fmt.Println(v)
|
|
}
|
|
|
|
func main() {
|
|
render(data{})
|
|
}
|
|
|
|
// Output:
|
|
// {}
|