Browse Source

private setIDIfEmpty

xuxin 1 year ago
parent
commit
3051e37973
2 changed files with 2 additions and 2 deletions
  1. 1 1
      perm/builder.go
  2. 1 1
      perm/policy.go

+ 1 - 1
perm/builder.go

@@ -82,7 +82,7 @@ func (b *Builder) Policies(ps ...*PolicyBuilder) (r *Builder) {
 }
 
 func (b *Builder) createPolicy(p *PolicyBuilder) {
-	p.SetIDIfEmpty()
+	p.setIDIfEmpty()
 	err := b.ladon.Manager.Create(p.policy)
 	if err != nil {
 		panic(err)

+ 1 - 1
perm/policy.go

@@ -61,7 +61,7 @@ func (b *PolicyBuilder) Given(conditions Conditions) (r *PolicyBuilder) {
 	return b
 }
 
-func (b *PolicyBuilder) SetIDIfEmpty() {
+func (b *PolicyBuilder) setIDIfEmpty() {
 	if b.policy.ID != "" {
 		return
 	}