robertkrimen / otto

A JavaScript interpreter in Go (golang)
http://godoc.org/github.com/robertkrimen/otto
MIT License
8.11k stars 586 forks source link

ignore fields with ignore tag #391

Closed sg3des closed 3 years ago

sg3des commented 3 years ago

Hello, may be add something like this? thats also should help to resolve problem with errors like reflect: NumField of non-struct type ... - https://github.com/robertkrimen/otto/issues/390 But i'm afraid it will break backward compatibility.

DeadlySurgeon commented 3 years ago

I don't think that this would be the right answer, as there will be structs to which you can't tag. A better idea would be to fix the reflect call to respect that the type is an Interface.

stevenh commented 3 years ago

Thanks for PR, but I agree with @DeadlySurgeon this is not the right fix.