Use new simplified uuid.NewString() syntax

This commit is contained in:
Deluan 2021-02-01 01:22:31 -05:00
parent b47ec02f02
commit 861b406575
10 changed files with 17 additions and 32 deletions

View file

@ -37,8 +37,7 @@ func (r sqlRepository) annUpsert(values map[string]interface{}, itemIDs ...strin
c, err := r.executeSQL(upd)
if c == 0 || err == orm.ErrNoRows {
for _, itemID := range itemIDs {
id, _ := uuid.NewRandom()
values["ann_id"] = id.String()
values["ann_id"] = uuid.NewString()
values["user_id"] = userId(r.ctx)
values["item_type"] = r.tableName
values["item_id"] = itemID
@ -68,9 +67,8 @@ func (r sqlRepository) IncPlayCount(itemID string, ts time.Time) error {
c, err := r.executeSQL(upd)
if c == 0 || err == orm.ErrNoRows {
id, _ := uuid.NewRandom()
values := map[string]interface{}{}
values["ann_id"] = id.String()
values["ann_id"] = uuid.NewString()
values["user_id"] = userId(r.ctx)
values["item_type"] = r.tableName
values["item_id"] = itemID