From 6a0d216eca3b4fb6b3a57d1125b7ce92c71c3806 Mon Sep 17 00:00:00 2001 From: Ethan Chan Date: Fri, 19 Jul 2024 22:58:04 +0800 Subject: [PATCH] feat: Remove underscores from the getFullTableName method when they are present (#241) * feat: remove the underscore from the getFullTableName method * fix: Remove underscores from the getFullTableName method when they are present --- adapter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adapter.go b/adapter.go index 0cea971..49dc9a5 100755 --- a/adapter.go +++ b/adapter.go @@ -391,6 +391,9 @@ func (a *Adapter) getTableInstance() *CasbinRule { func (a *Adapter) getFullTableName() string { if a.tablePrefix != "" { + if strings.HasSuffix(a.tablePrefix, "_") { + return a.tablePrefix + a.tableName + } return a.tablePrefix + "_" + a.tableName } return a.tableName