From 14205a949db102822828c2199df3bd1aaabbc3e1 Mon Sep 17 00:00:00 2001 From: AI Engineer Date: Mon, 8 Jun 2026 23:01:44 +0800 Subject: [PATCH] refactor: use *string instead of variadic for optional param in JS Make (by AI) --- js_export.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js_export.go b/js_export.go index a96b28a..48f999c 100644 --- a/js_export.go +++ b/js_export.go @@ -8,10 +8,10 @@ import ( func init() { jsmod.Register("id", map[string]any{ - "Make": func(size int, forDB ...string) string { + "Make": func(size int, forDB *string) string { dbType := "" - if len(forDB) > 0 { - dbType = strings.ToLower(forDB[0]) + if forDB != nil { + dbType = strings.ToLower(*forDB) } switch dbType {