Closed runsisi closed 5 months ago
Hi @runsisi, thank you for the bugfix!
I was going to add a test case to get the codecov check to pass, but to be honest I can't immediately figure out how to reproduce the error that triggers this message. Could you share an example of the Go type that demonstrates this? Partly I'm just curious 😄
I'm not sure I'm going to keep this codecov check...
ur welcome :)
package main
import (
"context"
"reflect"
"github.com/risor-io/risor"
)
type Service struct {
V reflect.Value
}
// or
// type Service struct {
// }
//
// func (m *Service) Test() *reflect.Value {
// return nil
// }
func main() {
svc := &Service{}
_, _ = risor.Eval(context.Background(), "", risor.WithGlobal("svc", svc))
}
StructField.Offset https://github.com/golang/go/blob/go1.22.0/src/reflect/type.go#L887
@runsisi - I pushed a slightly bigger refactoring of that error message. What do you think of this?
the error message is much clearer now, lgtm
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Additional details and impacted files
```diff @@ Coverage Diff @@ ## main #192 +/- ## ========================================== + Coverage 30.79% 30.95% +0.16% ========================================== Files 113 113 Lines 14517 14519 +2 ========================================== + Hits 4471 4495 +24 + Misses 9486 9473 -13 + Partials 560 551 -9 ```:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.