From 61c8413d3c81ab93288ee0a98577d7ea5a698b3e Mon Sep 17 00:00:00 2001 From: Nam Huynh Date: Thu, 19 Aug 2021 15:43:28 +0700 Subject: [PATCH] check query select --- find_by_device_id.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find_by_device_id.go b/find_by_device_id.go index a9af5f8..53843ed 100644 --- a/find_by_device_id.go +++ b/find_by_device_id.go @@ -10,7 +10,7 @@ import ( func (s Service) findByDeviceID(ctx context.Context, id string) (result Device) { stm, args, _ := s.Builder.Select("*").From(TableDeviceMngt).Where("device_id = ?", id).ToSql() - if err := s.DB.QueryRowContext(ctx, stm, args...).Scan(&result); err != nil { + if err := s.DB.GetContext(ctx, &result, stm, args...); err != nil { logger.Error("devicemngt - findByDeviceID", logger.LogData{ "device_id": id, "error": err.Error(),