所以我之前有this question个,我在问题下面有一个答案,这个答案是有效的,但我刚刚意识到我提出的问题并没有按计划进行.
基本上现在,如果它像这样工作
(if the roleskey contains any of the roles in slice) and (if the tenantID is an empty string) or (if tenantIDKey is equal to tenantID)
但我需要的是
(if the roleskey contains any of the roles in slice) AND (if the tenantID is an empty string OR if tenantIDKey is equal to tenantID)
以下是我目前的问题:
query := bolthold.Where(roleskey).ContainsAny(bolthold.Slice(roles)...).And(tenantIDKey).Eq("").Or(bolthold.Where(tenantIDKey).Eq(tenantID))
有人知道怎么解决这个问题吗?