func()

in dubbogo/simple/nacos/server/app/user.go [61:74]


func (db *UserDB) Add(u *User) bool {
	if u.Name == "" || u.Code <= 0 {
		return false
	}

	db.lock.Lock()
	defer db.lock.Unlock()

	if !db.existName(u.Name) && !db.existCode(u.Code) {
		return db.AddForName(u) && db.AddForCode(u)
	}

	return false
}