From cbacb9897aeb89452887bf39fb290ef2a77bcc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=97=AD=E7=BA=A2=20=28karminski-=E7=89=99?= =?UTF-8?q?=E5=8C=BB=29?= Date: Mon, 19 Feb 2024 18:46:04 +0800 Subject: [PATCH] ADD new size of method. --- src/actionruntime/postgresql/base.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/actionruntime/postgresql/base.go b/src/actionruntime/postgresql/base.go index 032da689..f484e95c 100644 --- a/src/actionruntime/postgresql/base.go +++ b/src/actionruntime/postgresql/base.go @@ -24,8 +24,8 @@ import ( "log" "net/url" "reflect" - "unsafe" + "github.com/DmitriyVTitov/size" "github.com/google/uuid" "github.com/jackc/pgx/v5" "github.com/mitchellh/mapstructure" @@ -180,7 +180,7 @@ func RetrieveToMap(rows pgx.Rows) ([]map[string]interface{}, error) { for i := 0; i < count; i++ { valuePtrs[i] = &values[i] // check valuePtrs size - valuePtrsSize := unsafe.Sizeof(valuePtrs) + valuePtrsSize := size.Of(valuePtrs) log.Printf("[DUMP] valuePtrsSize: %d\n", valuePtrsSize) } @@ -206,7 +206,7 @@ func RetrieveToMap(rows pgx.Rows) ([]map[string]interface{}, error) { tableData = append(tableData, entry) // check tableData size - tableDataSize := unsafe.Sizeof(tableData) + tableDataSize := size.Of(tableData) log.Printf("[DUMP] tableDataSize: %d\n", tableDataSize) } log.Printf("[DUMP] big loop end\n")