Explorar o código

security: fix var shadowing in CreateOrUpdate

Yicheng Qin %!s(int64=11) %!d(string=hai) anos
pai
achega
d7780cf293
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      etcdserver/security/security.go

+ 1 - 1
etcdserver/security/security.go

@@ -197,7 +197,7 @@ func (s *Store) GetRole(name string) (Role, error) {
 }
 
 func (s *Store) CreateOrUpdateRole(role Role) (Role, error) {
-	role, err := s.GetRole(role.Role)
+	_, err := s.GetRole(role.Role)
 	if err == nil {
 		return s.UpdateRole(role)
 	}