AEnjoy opened a new issue, #57:
URL: https://github.com/apache/casbin-pg-adapter/issues/57

   ```go
   import(
        pgadapter "github.com/casbin/casbin-pg-adapter"
        "github.com/casbin/casbin/v3"
   )
   func Enforcer(){
                   a, err := pgadapter.NewAdapter(dbDSN)
                if err != nil {
                        return nil, fmt.Errorf("casbin postgres adapter: %w", 
err)
                }
                adapter = a
                   e, err := casbin.NewEnforcer(cfg.ModelPath, adapter)
                if err != nil {
                           return nil, fmt.Errorf("casbin new enforcer: %w", 
err)
                }
   // .....
   }
   ```
   
   it will throw panic:
   
   ```
   panic: interface conversion: *pgadapter.Adapter is not persist.Adapter: 
missing method LoadPolicy
   
   goroutine 1 [running]:
   github.com/casbin/casbin/v3.NewEnforcer({0x3e2661c87558, 0x2, 0x0?})
           
/home/lyc/go/pkg/mod/github.com/casbin/casbin/[email protected]/enforcer.go:102 +0x3d9
   paas/internal/iam/infrastructure/casbin.NewEnforcer({{0x3e2661c20b00, 0x19}, 
{0x3e2661a8c460, 0x8}, 0x1, 0x1, {0x3e26613d2630, 0x16}, {0x3e26613d2648, 
0x17}, ...}, ...)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to