Initialize it somewhere
()
| 14 | |
| 15 | // Initialize it somewhere |
| 16 | func (amw *authenticationMiddleware) Populate() { |
| 17 | amw.tokenUsers["00000000"] = "user0" |
| 18 | amw.tokenUsers["aaaaaaaa"] = "userA" |
| 19 | amw.tokenUsers["05f717e5"] = "randomUser" |
| 20 | amw.tokenUsers["deadbeef"] = "user0" |
| 21 | } |
| 22 | |
| 23 | // Middleware function, which will be called for each request |
| 24 | func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler { |
no outgoing calls
no test coverage detected