Skip to content

Commit e186b4f

Browse files
MasatoshiTadavishr
authored andcommitted
Fix compilation error in Casbin Auth Middleware's sample code (#130)
1 parent 9b5dc19 commit e186b4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

website/content/middleware/casbin-auth.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ import (
3434

3535
```go
3636
e := echo.New()
37-
e.Use(casbin_mw.Middleware(casbin.NewEnforcer("casbin_auth_model.conf", "casbin_auth_policy.csv")))
37+
enforcer, err := casbin.NewEnforcer("casbin_auth_model.conf", "casbin_auth_policy.csv")
38+
e.Use(casbin_mw.Middleware(enforcer))
3839
```
3940

4041
For syntax, see: [Syntax for Models](https://casbin.org/docs/en/syntax-for-models).

0 commit comments

Comments
 (0)