From a8adc4eae3ccbb4ad25c7906cde50224d35c9626 Mon Sep 17 00:00:00 2001 From: luoxin Date: Sat, 19 Oct 2024 16:30:29 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E9=83=A8=E5=88=86=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/generate_struct_tag.go | 55 ++++++++++++++++++++++++++++++---- state/config.go | 24 +++++++++++---- 2 files changed, 68 insertions(+), 11 deletions(-) diff --git a/codegen/generate_struct_tag.go b/codegen/generate_struct_tag.go index dc92707..81c1d86 100644 --- a/codegen/generate_struct_tag.go +++ b/codegen/generate_struct_tag.go @@ -321,13 +321,43 @@ func InjectTagParseFile(inputPath string) ([]textArea, error) { // 先按照类型获取一下 var getFieldType func(xx ast.Expr) string - getFieldType = func(xx ast.Expr) string { + var getObjType func(xx *ast.Object) string + + getObjType = func(xx *ast.Object) string { + if xx == nil { + return "" + } + + if xx.Decl != nil { + switch x := xx.Decl.(type) { + case *ast.TypeSpec: + return getFieldType(x.Type) + + default: + log.Panicf("unknown type %T", x) + } + } + + return "" + } + + getFieldType = func(xx ast.Expr) (name string) { switch x := xx.(type) { case *ast.Ident: + name = getObjType(x.Obj) + if name != "" { + return name + } + return x.Name case *ast.StarExpr: - return "*" + getFieldType(x.X) + name = getFieldType(x.X) + if name == "" { + return "" + } + + return "*" + name case *ast.ArrayType: return "array" @@ -336,7 +366,11 @@ func InjectTagParseFile(inputPath string) ([]textArea, error) { return "map" case *ast.SelectorExpr: - return "*" + getFieldType(x.X) + // TODO + return "" + + case *ast.StructType: + return "object" default: log.Panicf("unknown type %T", x) @@ -347,16 +381,19 @@ func InjectTagParseFile(inputPath string) ([]textArea, error) { fieldType := getFieldType(field.Type) - log.Infof("field type: %s", fieldType) + log.Infof("%s field type: %s", fieldName, fieldType) tagsMap := make(map[string][]string) - if tm := state.Config.DefaultTag[fieldType]; tm != nil { + if tm := state.Config.DefaultTag["@"+fieldType]; tm != nil { for k, v := range tm { tagsMap[k] = append(tagsMap[k], v) } } + switch fieldType { + case "": + case "int32", "int64", "uint32", "uint64", "sint32", "sint64": case "float", "double", "float32", "float64": @@ -365,8 +402,14 @@ func InjectTagParseFile(inputPath string) ([]textArea, error) { case "bool": + case "array": + + case "map": + + case "object": + default: - if tm := state.Config.DefaultTag["object"]; tm != nil { + if tm := state.Config.DefaultTag["@object"]; tm != nil { for k, v := range tm { tagsMap[k] = append(tagsMap[k], v) } diff --git a/state/config.go b/state/config.go index 2481b3f..d1208f8 100644 --- a/state/config.go +++ b/state/config.go @@ -396,30 +396,34 @@ func (p *Cfg) apply() (err error) { } addBoolType := func(typ string) { + typ = "@" + typ if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { - p.DefaultTag["gorm"][typ] = "default:0;not null:type:tinyint(1)" + p.DefaultTag["gorm"][typ] = "default:0;not null;type:tinyint(1)" } else if p.Tables.DisableFieldType && ok { delete(p.DefaultTag["gorm"], typ) } } addIntegerType := func(typ string) { + typ = "@" + typ if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { - p.DefaultTag["gorm"][typ] = "not null:type:bigint(20)" + p.DefaultTag["gorm"][typ] = "not null;type:bigint(20)" } else if p.Tables.DisableFieldType && ok { delete(p.DefaultTag["gorm"], typ) } } addFloatingType := func(typ string) { + typ = "@" + typ if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { - p.DefaultTag["gorm"][typ] = "not null;type:decimal(65,8)" + p.DefaultTag["gorm"][typ] = "not null;type:decimal(65,8);default:0" } else if p.Tables.DisableFieldType && ok { delete(p.DefaultTag["gorm"], typ) } } addStringType := func(typ string) { + typ = "@" + typ if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { p.DefaultTag["gorm"][typ] = "type:varchar(255);not null" } else if p.Tables.DisableFieldType && ok { @@ -427,9 +431,19 @@ func (p *Cfg) apply() (err error) { } } + addTextType := func(typ string) { + typ = "@" + typ + if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { + p.DefaultTag["gorm"][typ] = "type:text" + } else if p.Tables.DisableFieldType && ok { + delete(p.DefaultTag["gorm"], typ) + } + } + addObjectType := func(typ string) { + typ = "@" + typ if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { - p.DefaultTag["gorm"][typ] = "type:json;not null" + p.DefaultTag["gorm"][typ] = "type:json" } else if p.Tables.DisableFieldType && ok { delete(p.DefaultTag["gorm"], typ) } @@ -452,7 +466,7 @@ func (p *Cfg) apply() (err error) { addStringType("string") addStringType("bytes") - addObjectType("array") + addTextType("array") addObjectType("map") addObjectType("object") From b4223d0a57c4eba57228f8b307ac6317b26a94ad Mon Sep 17 00:00:00 2001 From: luoxin Date: Sat, 19 Oct 2024 16:38:20 +0800 Subject: [PATCH 02/15] =?UTF-8?q?gorm=E4=B8=ADjson=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- state/config.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/state/config.go b/state/config.go index d1208f8..4255568 100644 --- a/state/config.go +++ b/state/config.go @@ -431,19 +431,19 @@ func (p *Cfg) apply() (err error) { } } - addTextType := func(typ string) { - typ = "@" + typ - if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { - p.DefaultTag["gorm"][typ] = "type:text" - } else if p.Tables.DisableFieldType && ok { - delete(p.DefaultTag["gorm"], typ) - } - } + //addTextType := func(typ string) { + // typ = "@" + typ + // if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { + // p.DefaultTag["gorm"][typ] = "type:text" + // } else if p.Tables.DisableFieldType && ok { + // delete(p.DefaultTag["gorm"], typ) + // } + //} addObjectType := func(typ string) { typ = "@" + typ if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { - p.DefaultTag["gorm"][typ] = "type:json" + p.DefaultTag["gorm"][typ] = "type:json;serializer:json" } else if p.Tables.DisableFieldType && ok { delete(p.DefaultTag["gorm"], typ) } @@ -466,7 +466,7 @@ func (p *Cfg) apply() (err error) { addStringType("string") addStringType("bytes") - addTextType("array") + addObjectType("array") addObjectType("map") addObjectType("object") From 8853e7d4c700f17b39896797927bddbc8f87397c Mon Sep 17 00:00:00 2001 From: luoxin Date: Sun, 20 Oct 2024 16:32:11 +0800 Subject: [PATCH 03/15] =?UTF-8?q?slice=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/generate_impl.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/codegen/generate_impl.go b/codegen/generate_impl.go index e2b00d3..eb6fd13 100644 --- a/codegen/generate_impl.go +++ b/codegen/generate_impl.go @@ -138,7 +138,7 @@ func generateImpl(pb *PbPackage, rpc *PbRPC) (err error) { case "str", "string": opt.FieldType = "string" - case "strs", "stringslice", "string-slice": + case "strs", "stringslice", "string-slice", "[]string": opt.FieldType = "string-slice" case "like": @@ -189,40 +189,40 @@ func generateImpl(pb *PbPackage, rpc *PbRPC) (err error) { case "b", "bool": opt.FieldType = "bool" - case "is", "ints", "intslice", "int-slice": + case "is", "ints", "intslice", "int-slice", "[]int": opt.FieldType = "int-slice" - case "i8s", "int8s", "int8slice", "int8-slice": + case "i8s", "int8s", "int8slice", "int8-slice", "[]int8": opt.FieldType = "int8-slice" - case "i16s", "int16s", "int16slice", "int16-slice": + case "i16s", "int16s", "int16slice", "int16-slice", "[]int16": opt.FieldType = "int16-slice" - case "i32s", "int32s", "int32slice", "int32-slice": + case "i32s", "int32s", "int32slice", "int32-slice", "[]int32": opt.FieldType = "int32-slice" - case "i64s", "int64s", "int64slice", "int64-slice": + case "i64s", "int64s", "int64slice", "int64-slice", "[]int64": opt.FieldType = "int64-slice" - case "us", "uints", "uintslice", "uint-slice": + case "us", "uints", "uintslice", "uint-slice", "[]uint": opt.FieldType = "uint-slice" - case "u16s", "uint16s", "uint16slice", "uint16-slice": + case "u16s", "uint16s", "uint16slice", "uint16-slice", "[]uint16": opt.FieldType = "uint16-slice" - case "u32s", "uint32s", "uint32slice", "uint32-slice": + case "u32s", "uint32s", "uint32slice", "uint32-slice", "[]uint32": opt.FieldType = "uint32-slice" - case "u64s", "uint64s", "uint64slice", "uint64-slice": + case "u64s", "uint64s", "uint64slice", "uint64-slice", "[]uint64": opt.FieldType = "uint64-slice" - case "f32s", "float32s", "float32slice", "float32-slice": + case "f32s", "float32s", "float32slice", "float32-slice", "[]float32": opt.FieldType = "float32-slice" - case "f64s", "float64s", "float64slice", "float64-slice": + case "f64s", "float64s", "float64slice", "float64-slice", "[]float64": opt.FieldType = "float64-slice" - case "bs", "bools", "boolslice", "bool-slice": + case "bs", "bools", "boolslice", "bool-slice", "[]bool": opt.FieldType = "bool-slice" } From 8bd3871d062a9f7377ad2dc0a24f8748a85e0e08 Mon Sep 17 00:00:00 2001 From: luoxin Date: Sun, 20 Oct 2024 16:40:05 +0800 Subject: [PATCH 04/15] =?UTF-8?q?slice=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/template/impl/list.rpc.gtpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/template/impl/list.rpc.gtpl b/codegen/template/impl/list.rpc.gtpl index 8273a0b..ef25a70 100644 --- a/codegen/template/impl/list.rpc.gtpl +++ b/codegen/template/impl/list.rpc.gtpl @@ -8,7 +8,7 @@ func {{ .RpcName }}(ctx *lrpc.Ctx, req *{{ .RequestPackage }}.{{ .RequestType }} scoop.Where({{ $.PB.GoPackageName }}.Db{{ $value.FieldName }}, value) return nil }).{{ else if eq $value.FieldType "string-slice" }} - StringSlice(int32({{ $.PB.GoPackageName }}.{{ $value.KeyField }}), func(value string) error { + StringSlice(int32({{ $.PB.GoPackageName }}.{{ $value.KeyField }}), func(value []string) error { scoop.In({{ $.PB.GoPackageName }}.Db{{ $value.FieldName }}, value) return nil }).{{ else if eq $value.FieldType "like" }} From 6e7ce85a6b391e8f1943e56ecfe042f25eaff8e5 Mon Sep 17 00:00:00 2001 From: luoxin Date: Tue, 22 Oct 2024 18:20:57 +0800 Subject: [PATCH 05/15] =?UTF-8?q?yaml=20=E6=A0=87=E7=AD=BE=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/generate_add_rpc.go | 3 +- codegen/generate_struct_tag.go | 7 +- codegen/name.go | 264 +++++++++++++++++++++------------ state/config.go | 1 + 4 files changed, 182 insertions(+), 93 deletions(-) diff --git a/codegen/generate_add_rpc.go b/codegen/generate_add_rpc.go index 7a40c33..f85259a 100644 --- a/codegen/generate_add_rpc.go +++ b/codegen/generate_add_rpc.go @@ -3,6 +3,7 @@ package codegen import ( "bytes" "fmt" + "github.com/lazygophers/codegen/state" "github.com/lazygophers/log" "github.com/lazygophers/utils/candy" "github.com/pterm/pterm" @@ -213,7 +214,7 @@ func GenerateAddRpc(pb *PbPackage, msg *PbMessage, opt *AddRpcOption) (err error args["RpcName"] = rpcName args["RequestType"] = rpcName + "Req" args["ResponseType"] = rpcName + "Rsp" - args["Path"] = CoverageStyledName(rpcName, opt.Model) + args["Path"] = CoverageStyledNamePath(state.Config.Style.Path, rpcName, opt.Model) // 处理 server.rpc if rpc := pb.GetRPC(rpcName); rpc == nil { diff --git a/codegen/generate_struct_tag.go b/codegen/generate_struct_tag.go index 81c1d86..1fc68c6 100644 --- a/codegen/generate_struct_tag.go +++ b/codegen/generate_struct_tag.go @@ -383,7 +383,12 @@ func InjectTagParseFile(inputPath string) ([]textArea, error) { log.Infof("%s field type: %s", fieldName, fieldType) - tagsMap := make(map[string][]string) + tagsMap := map[string][]string{ + "yaml": { + CoverageStyledBase(state.Config.Style.Yaml, fieldName), + "omitempty", + }, + } if tm := state.Config.DefaultTag["@"+fieldType]; tm != nil { for k, v := range tm { diff --git a/codegen/name.go b/codegen/name.go index 2fd55d8..f8fb65b 100644 --- a/codegen/name.go +++ b/codegen/name.go @@ -7,122 +7,204 @@ import ( "strings" ) -type NameStyleHandler func(source string, model string) (path string) +type NameStyleHandler struct { + Base func(source string) (target string) + NamePath func(source string, model string) (path string) +} var NameStyle = map[state.CfgStyleName]NameStyleHandler{ - state.CfgStyleNameDefault: func(source string, modele string) string { - return source - }, - state.CfgStyleNameCamel: func(source string, modele string) string { - return stringx.ToSmallCamel(source) - }, - state.CfgStyleNameSnake: func(source string, modele string) string { - return stringx.ToSnake(source) - }, - state.CfgStyleNameKebab: func(source string, modele string) string { - return stringx.ToKebab(source) - }, - state.CfgStyleNamePascal: func(source string, modele string) string { - return stringx.ToCamel(source) - }, - - state.CfgStyleNameSlash: func(source string, modele string) string { - return stringx.ToSlash(source) - }, - state.CfgStyleNameSlashSnake: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + modele - }, - state.CfgStyleNameSlashPascal: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + stringx.ToCamel(modele) - }, - state.CfgStyleNameSlashCamel: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + stringx.ToSmallCamel(modele) - }, - state.CfgStyleNameSlashKebab: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + stringx.ToKebab(modele) + state.CfgStyleNameDefault: { + Base: func(source string) string { + return stringx.ToSnake(source) + }, + NamePath: func(source string, modele string) string { + return source + }, + }, + state.CfgStyleNameCamel: { + Base: func(source string) (target string) { + return stringx.ToSmallCamel(source) + }, + NamePath: func(source string, modele string) string { + return stringx.ToSmallCamel(source) + }, + }, + state.CfgStyleNameSnake: { + Base: func(source string) (target string) { + return stringx.ToSnake(source) + }, + NamePath: func(source string, modele string) string { + return stringx.ToSnake(source) + }, + }, + state.CfgStyleNameKebab: { + Base: func(source string) (target string) { + return stringx.ToKebab(source) + }, + NamePath: func(source string, modele string) string { + return stringx.ToKebab(source) + }, + }, + state.CfgStyleNamePascal: { + Base: func(source string) (target string) { + return stringx.ToCamel(source) + }, + NamePath: func(source string, modele string) string { + return stringx.ToCamel(source) + }, + }, + + state.CfgStyleNameSlash: { + Base: func(source string) (target string) { + return stringx.ToSlash(source) + }, + NamePath: func(source string, modele string) string { + return stringx.ToSlash(source) + }, + }, + state.CfgStyleNameSlashSnake: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + modele + }, + }, + state.CfgStyleNameSlashPascal: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + stringx.ToCamel(modele) + }, + }, + state.CfgStyleNameSlashCamel: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + stringx.ToSmallCamel(modele) + }, + }, + state.CfgStyleNameSlashKebab: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + stringx.ToKebab(modele) + }, + }, + + state.CfgStyleNameSlashReverse: { + NamePath: func(source string, modele string) (path string) { + return strings.Join(candy.Reverse(strings.Split(stringx.ToSnake(source), "_")), "/") + }, + }, + state.CfgStyleNameSlashReverseSnake: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + + return modele + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/") + }, + }, + state.CfgStyleNameSlashReversePascal: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + + return stringx.ToCamel(modele) + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/") + }, + }, + state.CfgStyleNameSlashReverseCamel: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + + return stringx.ToSmallCamel(modele) + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/") + }, + }, + state.CfgStyleNameSlashReverseKebab: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + + return stringx.ToKebab(modele) + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/") + }, + }, + + state.CfgStyleNameDot: { + Base: func(source string) (target string) { + return stringx.ToDot(source) + }, + NamePath: func(source string, modele string) string { + return stringx.ToDot(source) + }, }, + state.CfgStyleNameDotSnake: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - state.CfgStyleNameSlashReverse: func(source string, modele string) (path string) { - return strings.Join(candy.Reverse(strings.Split(stringx.ToSnake(source), "_")), "/") + return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + modele + }, }, - state.CfgStyleNameSlashReverseSnake: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + state.CfgStyleNameDotPascal: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return modele + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/") + return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + stringx.ToCamel(modele) + }, }, - state.CfgStyleNameSlashReversePascal: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + state.CfgStyleNameDotCamel: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToCamel(modele) + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/") + return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + stringx.ToSmallCamel(modele) + }, }, - state.CfgStyleNameSlashReverseCamel: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + state.CfgStyleNameDotKebab: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToSmallCamel(modele) + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/") + return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + stringx.ToKebab(modele) + }, }, - state.CfgStyleNameSlashReverseKebab: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToKebab(modele) + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/") + state.CfgStyleNameDotReverse: { + NamePath: func(source string, modele string) (path string) { + return strings.Join(candy.Reverse(strings.Split(stringx.ToSnake(source), "_")), ".") + }, }, + state.CfgStyleNameDotReverseSnake: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - state.CfgStyleNameDot: func(source string, modele string) string { - return stringx.ToDot(source) + return modele + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".") + }, }, - state.CfgStyleNameDotSnake: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + state.CfgStyleNameDotReversePascal: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + modele + return stringx.ToCamel(modele) + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".") + }, }, - state.CfgStyleNameDotPascal: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + state.CfgStyleNameDotReverseCamel: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + stringx.ToCamel(modele) + return stringx.ToSmallCamel(modele) + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".") + }, }, - state.CfgStyleNameDotCamel: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") + state.CfgStyleNameDotReverseKebab: { + NamePath: func(source string, modele string) (path string) { + modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + stringx.ToSmallCamel(modele) + return stringx.ToKebab(modele) + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".") + }, }, - state.CfgStyleNameDotKebab: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - - return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + stringx.ToKebab(modele) - }, - - state.CfgStyleNameDotReverse: func(source string, modele string) (path string) { - return strings.Join(candy.Reverse(strings.Split(stringx.ToSnake(source), "_")), ".") - }, - state.CfgStyleNameDotReverseSnake: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - - return modele + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".") - }, - state.CfgStyleNameDotReversePascal: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") - - return stringx.ToCamel(modele) + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".") - }, - state.CfgStyleNameDotReverseCamel: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") +} - return stringx.ToSmallCamel(modele) + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".") - }, - state.CfgStyleNameDotReverseKebab: func(source string, modele string) (path string) { - modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_") +func CoverageStyledBase(style state.CfgStyleName, source string) string { + if v, ok := NameStyle[style]; ok { + return v.Base(source) + } - return stringx.ToKebab(modele) + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".") - }, + return NameStyle[state.CfgStyleNameDefault].Base(source) } -func CoverageStyledName(source string, model string) string { - if v, ok := NameStyle[state.Config.Style.Path]; ok { - return v(source, model) +func CoverageStyledNamePath(style state.CfgStyleName, source string, model string) string { + if v, ok := NameStyle[style]; ok { + return v.NamePath(source, model) } - return NameStyle[state.CfgStyleNameDefault](source, model) + return NameStyle[state.CfgStyleNameDefault].NamePath(source, model) } diff --git a/state/config.go b/state/config.go index 4255568..8b5518a 100644 --- a/state/config.go +++ b/state/config.go @@ -120,6 +120,7 @@ func (p *CfgStyleName) MarshalYAML() (interface{}, error) { type CfgStyle struct { Path CfgStyleName `json:"path,omitempty" yaml:"path,omitempty" toml:"path,omitempty"` + Yaml CfgStyleName `json:"yaml,omitempty" yaml:"yaml,omitempty" toml:"yaml,omitempty"` } type CfgProtoAction struct { From 3a99dd303f798afe5ae5928ee91c5d68d5765741 Mon Sep 17 00:00:00 2001 From: luoxin Date: Wed, 23 Oct 2024 16:28:55 +0800 Subject: [PATCH 06/15] =?UTF-8?q?yaml=20=E6=A0=87=E7=AD=BE=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/name.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/name.go b/codegen/name.go index f8fb65b..1046ae5 100644 --- a/codegen/name.go +++ b/codegen/name.go @@ -15,7 +15,7 @@ type NameStyleHandler struct { var NameStyle = map[state.CfgStyleName]NameStyleHandler{ state.CfgStyleNameDefault: { Base: func(source string) string { - return stringx.ToSnake(source) + return source }, NamePath: func(source string, modele string) string { return source From 56b71dd72d168e693e77dede8607448965017187 Mon Sep 17 00:00:00 2001 From: luoxin Date: Sat, 9 Nov 2024 11:05:30 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=80=BC=E7=B1=BB=E5=9E=8B=E7=9A=84=E8=A7=A3=E6=9E=90=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/pbparse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/pbparse.go b/codegen/pbparse.go index a3bc23f..60327fe 100644 --- a/codegen/pbparse.go +++ b/codegen/pbparse.go @@ -316,7 +316,7 @@ func (p *PbRPC) walk() { if strings.Contains(p.rpc.ReturnsType, ".") { text := p.rpc.ReturnsType if idx := strings.LastIndex(text, "."); idx > 0 { - p.requestType = text[idx+1:] + p.responsePackage = text[idx+1:] text = text[:idx] } if idx := strings.LastIndex(text, "."); idx > 0 { From 8699b11d17b9bd87d6c9a5ac9c4d92e8394011f5 Mon Sep 17 00:00:00 2001 From: luoxin Date: Fri, 22 Nov 2024 16:01:31 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9C=AB=E7=8F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/template/impl/set.rpc.gtpl | 2 +- codegen/template/state/table.gtpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/template/impl/set.rpc.gtpl b/codegen/template/impl/set.rpc.gtpl index a564715..15df1b3 100644 --- a/codegen/template/impl/set.rpc.gtpl +++ b/codegen/template/impl/set.rpc.gtpl @@ -6,7 +6,7 @@ func {{ .RpcName }}(ctx *lrpc.Ctx, req *{{ .RequestPackage }}.{{ .RequestType }} err := state.{{ ToCamel (TrimPrefix .Model "Model") }}. NewScoop(). Where("{{ .PrimaryKey }} = ?", {{ ToSmallCamel (TrimPrefix .Model "Model") }}.{{ ToCamel .PrimaryKey }}). - Updates(&{{ ToSmallCamel (TrimPrefix .Model "Model") }}). + Updates({{ ToSmallCamel (TrimPrefix .Model "Model") }}). Error if err != nil { log.Errorf("err:%v", err) diff --git a/codegen/template/state/table.gtpl b/codegen/template/state/table.gtpl index 74dd045..ed0ad74 100644 --- a/codegen/template/state/table.gtpl +++ b/codegen/template/state/table.gtpl @@ -27,7 +27,7 @@ func ConnectDatabase() (err error) { SetNotFound(xerror.NewError(int32({{ $.PB.GoPackageName }}.ErrCode_{{TrimPrefix $value "Model"}}NotFound))){{ end }}{{ if $.EnableErrorDuplicateKey }}. SetDuplicatedKeyError(xerror.NewError(int32({{ $.PB.GoPackageName }}.ErrCode_{{TrimPrefix $value "Model"}}DuplicateKey))){{ end }} {{ end }} - log.Info("connect mysql successfully") + log.Info("connect database successfully") return nil } From 6e83f5b73c8c115dc1fab4544d2004dca5d2115d Mon Sep 17 00:00:00 2001 From: luoxin Date: Thu, 5 Dec 2024 21:04:54 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=20-=20=EF=BC=8C=E5=88=99=E8=B7=B3=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/generate_struct_tag.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/codegen/generate_struct_tag.go b/codegen/generate_struct_tag.go index 1fc68c6..3c7112a 100644 --- a/codegen/generate_struct_tag.go +++ b/codegen/generate_struct_tag.go @@ -68,6 +68,15 @@ func (p tagItems) override() tagItems { return s != "" }) + // 校验如果存在 - ,则跳过 + if candy.Contains(v, "-") { + overrided = append(overrided, tagItem{ + key: k, + value: "-", + }) + continue + } + switch k { case "gorm": overrided = append(overrided, tagItem{ From 753f738171690a9e9390a025769cee73857837c8 Mon Sep 17 00:00:00 2001 From: luoxin Date: Tue, 17 Dec 2024 23:33:17 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=B9=20tag=20?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/generate_struct_tag.go | 7 ++++--- state/config.go | 17 ++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/codegen/generate_struct_tag.go b/codegen/generate_struct_tag.go index 3c7112a..5edc2a7 100644 --- a/codegen/generate_struct_tag.go +++ b/codegen/generate_struct_tag.go @@ -67,6 +67,7 @@ func (p tagItems) override() tagItems { v = candy.Filter(v, func(s string) bool { return s != "" }) + v = candy.Unique(v) // 校验如果存在 - ,则跳过 if candy.Contains(v, "-") { @@ -305,11 +306,11 @@ func InjectTagParseFile(inputPath string) ([]textArea, error) { } for _, value := range strings.Split(values, seq) { - idx := strings.Index(value, connect) - if idx < 0 { + before, _, found := strings.Cut(value, connect) + if !found { delete(m, value) } else { - delete(m, value[:idx]) + delete(m, before) } } diff --git a/state/config.go b/state/config.go index 8b5518a..9c10542 100644 --- a/state/config.go +++ b/state/config.go @@ -373,19 +373,19 @@ func (p *Cfg) apply() (err error) { } if _, ok := p.DefaultTag["gorm"]["id"]; !p.Tables.DisableFieldId && !ok { - p.DefaultTag["gorm"]["id"] = "column:id;primaryKey;autoIncrement;not null" + p.DefaultTag["gorm"]["id"] = "column:id;primaryKey;autoIncrement;autoIncrementIncrement:1;not null" } else if p.Tables.DisableFieldId && ok { delete(p.DefaultTag["gorm"], "id") } if _, ok := p.DefaultTag["gorm"]["created_at"]; !p.Tables.DisableFieldCreatedAt && !ok { - p.DefaultTag["gorm"]["created_at"] = "autoCreateTime;<-:create;column:created_at;not null" + p.DefaultTag["gorm"]["created_at"] = "autoCreateTime;column:created_at;not null" } else if p.Tables.DisableFieldCreatedAt && ok { delete(p.DefaultTag["gorm"], "created_at") } if _, ok := p.DefaultTag["gorm"]["updated_at"]; !p.Tables.DisableFieldUpdatedAt && !ok { - p.DefaultTag["gorm"]["updated_at"] = "autoUpdateTime;<-:;column:updated_at;not null" + p.DefaultTag["gorm"]["updated_at"] = "autoUpdateTime;column:updated_at;not null" } else if p.Tables.DisableFieldUpdatedAt && ok { delete(p.DefaultTag["gorm"], "updated_at") } @@ -408,7 +408,7 @@ func (p *Cfg) apply() (err error) { addIntegerType := func(typ string) { typ = "@" + typ if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { - p.DefaultTag["gorm"][typ] = "not null;type:bigint(20)" + p.DefaultTag["gorm"][typ] = "not null;default:0" } else if p.Tables.DisableFieldType && ok { delete(p.DefaultTag["gorm"], typ) } @@ -432,15 +432,6 @@ func (p *Cfg) apply() (err error) { } } - //addTextType := func(typ string) { - // typ = "@" + typ - // if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { - // p.DefaultTag["gorm"][typ] = "type:text" - // } else if p.Tables.DisableFieldType && ok { - // delete(p.DefaultTag["gorm"], typ) - // } - //} - addObjectType := func(typ string) { typ = "@" + typ if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { From b4dbfd41cf0bc1ef46c715b959da7ba29a244186 Mon Sep 17 00:00:00 2001 From: luoxin Date: Sun, 29 Dec 2024 01:19:49 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=80=E5=87=BA?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli/root.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/root.go b/cli/root.go index 9e496b7..15abe69 100644 --- a/cli/root.go +++ b/cli/root.go @@ -42,6 +42,7 @@ func Run() { if err != nil { pterm.Error.Printfln("load state error\n%s", err.Error()) log.Errorf("err:%v", err) + os.Exit(1) return } @@ -59,6 +60,7 @@ func Run() { err = rootCmd.Execute() if err != nil { log.Errorf("err:%v", err) + os.Exit(1) return } } From 01a40c236ceaf570bba0d52886b4e461113f90e2 Mon Sep 17 00:00:00 2001 From: luoxin Date: Sun, 29 Dec 2024 01:21:17 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=20gorm=20=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=A0=87=E7=AD=BE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- state/config.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/state/config.go b/state/config.go index 9c10542..34561ab 100644 --- a/state/config.go +++ b/state/config.go @@ -408,7 +408,16 @@ func (p *Cfg) apply() (err error) { addIntegerType := func(typ string) { typ = "@" + typ if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { - p.DefaultTag["gorm"][typ] = "not null;default:0" + p.DefaultTag["gorm"][typ] = "not null;default:0;type:bigint(20)" + } else if p.Tables.DisableFieldType && ok { + delete(p.DefaultTag["gorm"], typ) + } + } + + addUnsignedIntegerType := func(typ string) { + typ = "@" + typ + if _, ok := p.DefaultTag["gorm"][typ]; !p.Tables.DisableFieldId && !ok { + p.DefaultTag["gorm"][typ] = "not null;default:0;type:bigint(20) unsigned" } else if p.Tables.DisableFieldType && ok { delete(p.DefaultTag["gorm"], typ) } @@ -445,10 +454,10 @@ func (p *Cfg) apply() (err error) { addIntegerType("int32") addIntegerType("int64") - addIntegerType("uint32") - addIntegerType("uint64") - addIntegerType("sint64") + addUnsignedIntegerType("uint32") + addUnsignedIntegerType("uint64") addIntegerType("sint32") + addIntegerType("sint64") addFloatingType("float") addFloatingType("double") From c16ed5b45e740a976c61cf05361807008c2298a6 Mon Sep 17 00:00:00 2001 From: luoxin Date: Sun, 29 Dec 2024 01:21:34 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E9=92=88=E5=AF=B9=E7=89=B9=E5=AE=9A?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=B7=BB=E5=8A=A0=20goland=20=E5=BF=BD?= =?UTF-8?q?=E7=95=A5=E6=A0=A1=E9=AA=8C=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/template/impl/add.rpc.gtpl | 1 + codegen/template/impl/set.rpc.gtpl | 1 + 2 files changed, 2 insertions(+) diff --git a/codegen/template/impl/add.rpc.gtpl b/codegen/template/impl/add.rpc.gtpl index 1c04f07..f3cdb3e 100644 --- a/codegen/template/impl/add.rpc.gtpl +++ b/codegen/template/impl/add.rpc.gtpl @@ -1,6 +1,7 @@ func {{ .RpcName }}(ctx *lrpc.Ctx, req *{{ .RequestPackage }}.{{ .RequestType }}) (*{{ .ResponsePackage }}.{{ .ResponseType }}, error) { var rsp {{ .ResponsePackage }}.{{ .ResponseType }} + //goland:noinspection GoVetCopyLock {{ ToSmallCamel (TrimPrefix .Model "Model") }} := *req.{{ ToCamel (TrimPrefix .Model "Model") }} {{ ToSmallCamel (TrimPrefix .Model "Model") }}.{{ ToCamel .PrimaryKey }} = 0 diff --git a/codegen/template/impl/set.rpc.gtpl b/codegen/template/impl/set.rpc.gtpl index 15df1b3..950de37 100644 --- a/codegen/template/impl/set.rpc.gtpl +++ b/codegen/template/impl/set.rpc.gtpl @@ -1,6 +1,7 @@ func {{ .RpcName }}(ctx *lrpc.Ctx, req *{{ .RequestPackage }}.{{ .RequestType }}) (*{{ .ResponsePackage }}.{{ .ResponseType }}, error) { var rsp {{ .ResponsePackage }}.{{ .ResponseType }} + //goland:noinspection GoVetCopyLock {{ ToSmallCamel (TrimPrefix .Model "Model") }} := req.{{ ToCamel (TrimPrefix .Model "Model") }} err := state.{{ ToCamel (TrimPrefix .Model "Model") }}. From 1b2e213fd66f08e7cded784e663b3d0302265a1f Mon Sep 17 00:00:00 2001 From: luoxin Date: Sun, 29 Dec 2024 01:21:49 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=20gorm=20=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E7=94=9F=E6=88=90=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/generate_add_rpc.go | 2 +- codegen/generate_struct_tag.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/codegen/generate_add_rpc.go b/codegen/generate_add_rpc.go index f85259a..994d9cb 100644 --- a/codegen/generate_add_rpc.go +++ b/codegen/generate_add_rpc.go @@ -154,7 +154,7 @@ func GenerateAddRpc(pb *PbPackage, msg *PbMessage, opt *AddRpcOption) (err error // NOTE: 寻找主键 pkField := msg.PrimaryField() - + var rpcBlock string for action, actionOpt := range opt.Action { diff --git a/codegen/generate_struct_tag.go b/codegen/generate_struct_tag.go index 5edc2a7..1aa475e 100644 --- a/codegen/generate_struct_tag.go +++ b/codegen/generate_struct_tag.go @@ -80,6 +80,13 @@ func (p tagItems) override() tagItems { switch k { case "gorm": + if candy.Contains(v, "autoIncrement") { + // 自动的,不添加 default + v = candy.FilterNot(v, func(s string) bool { + return strings.Contains(s, "default:") + }) + } + overrided = append(overrided, tagItem{ key: k, value: strings.Join(v, ";"), From 8fb142bdf2edd0064334a6564d098844d3dc08f1 Mon Sep 17 00:00:00 2001 From: luoxin Date: Tue, 31 Dec 2024 17:28:05 +0800 Subject: [PATCH 15/15] update --- go.mod | 46 +++++++++++++++--------------- go.sum | 90 ++++++++++++++++++++++++++++------------------------------ 2 files changed, 67 insertions(+), 69 deletions(-) diff --git a/go.mod b/go.mod index d64de88..8bd2512 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/lazygophers/codegen -go 1.21.6 +go 1.22.0 -toolchain go1.22.3 +toolchain go1.23.4 require ( github.com/Xuanwo/go-locale v1.1.0 @@ -10,15 +10,15 @@ require ( github.com/go-git/go-git/v5 v5.12.0 github.com/go-resty/resty/v2 v2.13.1 github.com/gookit/color v1.5.4 - github.com/lazygophers/log v0.0.0-20240611102854-776123d17d8c + github.com/lazygophers/log v0.0.0-20241229160530-2bac6f5670ab github.com/lazygophers/lrpc v0.0.0-20240611132523-488159748780 - github.com/lazygophers/utils v0.0.0-20240611102917-4283d102dad5 - github.com/pelletier/go-toml/v2 v2.2.2 - github.com/pterm/pterm v0.12.79 + github.com/lazygophers/utils v0.0.0-20241229161346-23023c36070c + github.com/pelletier/go-toml/v2 v2.2.3 + github.com/pterm/pterm v0.12.80 github.com/spf13/cobra v1.8.1 go.uber.org/atomic v1.11.0 - golang.org/x/mod v0.18.0 - golang.org/x/text v0.16.0 + golang.org/x/mod v0.22.0 + golang.org/x/text v0.21.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.1 ) @@ -30,14 +30,14 @@ require ( dario.cat/mergo v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v1.0.0 // indirect - github.com/bytedance/sonic v1.11.8 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/bytedance/sonic v1.12.6 // indirect + github.com/bytedance/sonic/loader v0.2.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect github.com/containerd/console v1.0.4 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect - github.com/elliotchance/pie/v2 v2.8.0 // indirect + github.com/elliotchance/pie/v2 v2.9.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect @@ -47,12 +47,12 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect + github.com/klauspost/cpuid/v2 v2.2.9 // indirect github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect - github.com/lestrrat-go/strftime v1.0.6 // indirect + github.com/lestrrat-go/strftime v1.1.0 // indirect github.com/lithammer/fuzzysearch v1.1.8 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/petermattis/goid v0.0.0-20240503122002-4b96552b8156 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/petermattis/goid v0.0.0-20241211131331-93ee7e083c43 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect @@ -64,14 +64,14 @@ require ( github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/arch v0.12.0 // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/tools v0.28.0 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/go.sum b/go.sum index 69d990b..a199248 100644 --- a/go.sum +++ b/go.sum @@ -30,10 +30,11 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bytedance/sonic v1.11.8 h1:Zw/j1KfiS+OYTi9lyB3bb0CFxPJVkM17k1wyDG32LRA= -github.com/bytedance/sonic v1.11.8/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic v1.12.6 h1:/isNmCUF2x3Sh8RAp/4mh4ZGkcFAX/hLrzrK3AvpRzk= +github.com/bytedance/sonic v1.12.6/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iCjjJv3+E= +github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= @@ -44,6 +45,7 @@ github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQ github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro= github.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -51,8 +53,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/elliotchance/pie/v2 v2.8.0 h1://QS43W8sEha8XV/fjngO5iMudN3XARJV5cpBayAcVY= -github.com/elliotchance/pie/v2 v2.8.0/go.mod h1:18t0dgGFH006g4eVdDtWfgFZPQEgl10IoEO8YWEq3Og= +github.com/elliotchance/pie/v2 v2.9.1 h1:v7TdC6ZdNZJ1HACofpLXvGKHUk307AjY/bttwDPWKEQ= +github.com/elliotchance/pie/v2 v2.9.1/go.mod h1:18t0dgGFH006g4eVdDtWfgFZPQEgl10IoEO8YWEq3Og= github.com/emicklei/proto v1.13.2 h1:z/etSFO3uyXeuEsVPzfl56WNgzcvIr42aQazXaQmFZY= github.com/emicklei/proto v1.13.2/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -94,8 +96,8 @@ github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= +github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -104,29 +106,29 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lazygophers/log v0.0.0-20240611102854-776123d17d8c h1:EPMTGmFAN2Ij8lBc6ErGBEv3Hxnp97amJOlIiOy6TXo= -github.com/lazygophers/log v0.0.0-20240611102854-776123d17d8c/go.mod h1:SfqLoBo31Abol6sknSBmlctFCRYCcKtaCQgWWrBWryM= +github.com/lazygophers/log v0.0.0-20241229160530-2bac6f5670ab h1:exBrC4IgzacgzmM7hVydV541Arpcu7xtmFDMUBV/dZ0= +github.com/lazygophers/log v0.0.0-20241229160530-2bac6f5670ab/go.mod h1:iLldWl6m/hnJVDSYTAtsKOAY19WExWh4mDSMHV6QGBg= github.com/lazygophers/lrpc v0.0.0-20240611132523-488159748780 h1:qflQnD4IkzAkXAYoFgoOiEK7iVOPg6KgF5oSnT8YA5c= github.com/lazygophers/lrpc v0.0.0-20240611132523-488159748780/go.mod h1:c6gRjunFxbCPthVPcYLcXrnnPXH1a1oHpIUE4Igmht8= -github.com/lazygophers/utils v0.0.0-20240611102917-4283d102dad5 h1:PBn9JrJ1NzG/wsOgR4qEZwq8RNzERInLbKw/P8zS/Ds= -github.com/lazygophers/utils v0.0.0-20240611102917-4283d102dad5/go.mod h1:kXKfJwTxqxc3UUiVUBEKVux5SjiuJcqzOUO4szwRa/8= +github.com/lazygophers/utils v0.0.0-20241229161346-23023c36070c h1:GBYcwcOE8MLUAKFWmrQyxSIf7OUhlokhaRtb5mWD7qI= +github.com/lazygophers/utils v0.0.0-20241229161346-23023c36070c/go.mod h1:nNd5mTN5aXYcuv9Rt3O9QogxElORwaD5ai7uQv/gEa8= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= -github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= -github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= +github.com/lestrrat-go/strftime v1.1.0 h1:gMESpZy44/4pXLO/m+sL0yBd1W6LjgjrrD4a68Gapyg= +github.com/lestrrat-go/strftime v1.1.0/go.mod h1:uzeIB52CeUJenCo1syghlugshMysrqUT51HlxphXVeI= github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4= github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= -github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= -github.com/petermattis/goid v0.0.0-20240503122002-4b96552b8156 h1:UOk0WKXxKXmHSlIkwQNhT5AWlMtkijU5pfj8bCOI9vQ= -github.com/petermattis/goid v0.0.0-20240503122002-4b96552b8156/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/petermattis/goid v0.0.0-20241211131331-93ee7e083c43 h1:ah1dvbqPMN5+ocrg/ZSgZ6k8bOk+kcZQ7fnyx6UvOm4= +github.com/petermattis/goid v0.0.0-20241211131331-93ee7e083c43/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -140,8 +142,8 @@ github.com/pterm/pterm v0.12.31/go.mod h1:32ZAWZVXD7ZfG0s8qqHXePte42kdz8ECtRyEej github.com/pterm/pterm v0.12.33/go.mod h1:x+h2uL+n7CP/rel9+bImHD5lF3nM9vJj80k9ybiiTTE= github.com/pterm/pterm v0.12.36/go.mod h1:NjiL09hFhT/vWjQHSj1athJpx6H8cjpHXNAK5bUw8T8= github.com/pterm/pterm v0.12.40/go.mod h1:ffwPLwlbXxP+rxT0GsgDTzS3y3rmpAO1NMjUkGTYf8s= -github.com/pterm/pterm v0.12.79 h1:lH3yrYMhdpeqX9y5Ep1u7DejyHy7NSQg9qrBjF9dFT4= -github.com/pterm/pterm v0.12.79/go.mod h1:1v/gzOF1N0FsjbgTHZ1wVycRkKiatFvJSJC4IGaQAAo= +github.com/pterm/pterm v0.12.80 h1:mM55B+GnKUnLMUSqhdINe4s6tOuVQIetQ3my8JGyAIg= +github.com/pterm/pterm v0.12.80/go.mod h1:c6DeF9bSnOSeFPZlfs4ZRAFcf5SCoTwvwQ5xaKGQlHo= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= @@ -159,21 +161,19 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v1.6.7 h1:I6tZjLXD2Q1kjvNbIzB1wvQBsXmKXiVrhpRE8ZjP5jY= github.com/smartystreets/goconvey v1.6.7/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -192,9 +192,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= -golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= +golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -202,14 +201,14 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= -golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 h1:LoYXNGAShUG3m/ehNk4iFctuhGX/+R1ZpfJ4/ia80JM= -golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo= +golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -221,13 +220,13 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -249,8 +248,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -261,8 +260,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -273,8 +272,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -282,8 +281,8 @@ golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= @@ -303,4 +302,3 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=