Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAML Test fails with chi Profiler middleware. #3

Open
zbindenren opened this issue Sep 7, 2017 · 1 comment
Open

RAML Test fails with chi Profiler middleware. #3

zbindenren opened this issue Sep 7, 2017 · 1 comment

Comments

@zbindenren
Copy link

If I add the the profiler in the raml test here like:

...
r.Get("/panic", func(w http.ResponseWriter, r *http.Request) {                                                                                                                 
    panic("test")
})  
r.Mount("/debug", middleware.Profiler()) //<- this is new
r.Route("/articles", func(r chi.Router) { 
...

the test panics:

--- FAIL: TestWalkerRAML (0.01s)
panic: reflect: call of reflect.Value.Pointer on string Value [recovered]
        panic: reflect: call of reflect.Value.Pointer on string Value

goroutine 6 [running]:
testing.tRunner.func1(0xc4201380f0)
        /home/rz/.gimme/versions/go1.9.linux.amd64/src/testing/testing.go:711 +0x2d2
panic(0x7d7a20, 0xc4203baec0)
        /home/rz/.gimme/versions/go1.9.linux.amd64/src/runtime/panic.go:491 +0x283
reflect.Value.Pointer(0x7d3420, 0xc420010e20, 0x98, 0xc420010e20)
        /home/rz/.gimme/versions/go1.9.linux.amd64/src/reflect/value.go:1276 +0x185
git.pnet.ch/mule/mule/vendor/github.com/go-chi/docgen.getCallerFrame(0x7d3420, 0xc420010e20, 0xc42023dd70)
        /home/rz/golang/src/git.pnet.ch/mule/mule/vendor/github.com/go-chi/docgen/funcinfo.go:70 +0x6f
git.pnet.ch/mule/mule/vendor/github.com/go-chi/docgen.GetFuncInfo(0x7d3420, 0xc420010e20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/rz/golang/src/git.pnet.ch/mule/mule/vendor/github.com/go-chi/docgen/funcinfo.go:25 +0x91
git.pnet.ch/mule/mule/vendor/github.com/go-chi/docgen/raml_test.TestWalkerRAML.func1(0x8526cc, 0x4, 0xc4203b21c0, 0x14, 0xa582c0, 0xc420010e20, 0xc4203b6d20, 0x4, 0x6, 0x0, ...)
        /home/rz/golang/src/git.pnet.ch/mule/mule/vendor/github.com/go-chi/docgen/raml/raml_test.go:30 +0x5f
git.pnet.ch/mule/mule/vendor/github.com/go-chi/chi.walk(0xa59240, 0xc42008d1f0, 0xc420010f80, 0xc42001a9b8, 0x8, 0xc420240000, 0x3, 0x4, 0x0, 0x0)
        /home/rz/golang/src/git.pnet.ch/mule/mule/vendor/github.com/go-chi/chi/tree.go:798 +0x397
git.pnet.ch/mule/mule/vendor/github.com/go-chi/chi.walk(0xa59240, 0xc42008d180, 0xc420010f80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x870200, 0xa59240)
        /home/rz/golang/src/git.pnet.ch/mule/mule/vendor/github.com/go-chi/chi/tree.go:779 +0x6a9
git.pnet.ch/mule/mule/vendor/github.com/go-chi/chi.Walk(0xa59240, 0xc42008d180, 0xc420010f80, 0xa59240, 0xc42008d180)
        /home/rz/golang/src/git.pnet.ch/mule/mule/vendor/github.com/go-chi/chi/tree.go:769 +0x6c
git.pnet.ch/mule/mule/vendor/github.com/go-chi/docgen/raml_test.TestWalkerRAML(0xc4201380f0)
        /home/rz/golang/src/git.pnet.ch/mule/mule/vendor/github.com/go-chi/docgen/raml/raml_test.go:29 +0x16c
testing.tRunner(0xc4201380f0, 0x8702e0)
        /home/rz/.gimme/versions/go1.9.linux.amd64/src/testing/testing.go:746 +0xd0
created by testing.(*T).Run
        /home/rz/.gimme/versions/go1.9.linux.amd64/src/testing/testing.go:789 +0x2de
exit status 2
FAIL    git.pnet.ch/mule/mule/vendor/github.com/go-chi/docgen/raml      0.021s
@rdelaage
Copy link

Any update? I have the same problem here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants