go-macaron / auth Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I try the example code from https://github.com/go-macaron/auth/blob/master/example/main.go
and i got only an PANIC from macron, that is loses the *macaron.Context
Try it on go version go1.8.1 windows/amd64 and it failed.
If i try it on linux, it works. Same go version.
go version go1.8.1 linux/amd64
curl --user 'admin:guessme' http://localhost:4000
Hello World!
I am not sure if this is an macron or go-macaron/auth issue.
"C:\Program Files (x86)\JetBrains\Gogland 171.3780.106\bin\runnerw.exe" C:\Go\bin\go.exe run C:/Users/4horsmann/go/src/macarontest/main.go
[Macaron] listening on 0.0.0.0:4000 (development)
[Macaron] 2017-06-13 14:41:48: Started GET / for [::1]
[Macaron] PANIC: Value not found for type *macaron.Context
C:/Go/src/runtime/panic.go:489 (0x42ac5d)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/context.go:123 (0x71054d)
(*Context).run: panic(err)
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/context.go:112 (0x71030d)
(*Context).Next: c.run()
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/recovery.go:161 (0x720032)
Recovery.func1: c.Next()
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/logger.go:40 (0x71397f)
LoggerInvoker.Invoke: invoke(params[0].(*Context), params[1].(*log.Logger))
C:/Users/4horsmann/go/src/github.com/go-macaron/inject/inject.go:157 (0x70e799)
(*injector).fastInvoke: return f.Invoke(in)
C:/Users/4horsmann/go/src/github.com/go-macaron/inject/inject.go:135 (0x70e582)
(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/context.go:121 (0x7103f9)
(*Context).run: vals, err := c.Invoke(c.handler())
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/context.go:112 (0x71030d)
(*Context).Next: c.run()
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/logger.go:52 (0x71f2eb)
Logger.func1: ctx.Next()
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/logger.go:40 (0x71397f)
LoggerInvoker.Invoke: invoke(params[0].(*Context), params[1].(*log.Logger))
C:/Users/4horsmann/go/src/github.com/go-macaron/inject/inject.go:157 (0x70e799)
(*injector).fastInvoke: return f.Invoke(in)
C:/Users/4horsmann/go/src/github.com/go-macaron/inject/inject.go:135 (0x70e582)
(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/context.go:121 (0x7103f9)
(*Context).run: vals, err := c.Invoke(c.handler())
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/router.go:187 (0x720750)
(*Router).Handle.func1: c.run()
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/router.go:296 (0x719344)
(*Router).ServeHTTP: h(rw, req, p)
C:/Users/4horsmann/go/src/gopkg.in/macaron.v1/macaron.go:220 (0x7150f3)
(*Macaron).ServeHTTP: m.Router.ServeHTTP(rw, req)
C:/Go/src/net/http/server.go:2568 (0x65a4b9)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
C:/Go/src/net/http/server.go:1825 (0x656869)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
C:/Go/src/runtime/asm_amd64.s:2197 (0x4554c1)
goexit: BYTE $0x90 // NOP
[Macaron] 2017-06-13 14:41:48: Completed / 500 Internal Server Error in 41ms
Good Morning!
Could you create an example for BearerFunc? Does it work with JWT?
I do not understand very well, thank you.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.