From 7df777e70afa01210f34da217e1b2099cc94449a Mon Sep 17 00:00:00 2001 From: Keilin Olsen Date: Mon, 26 Sep 2022 19:51:53 +1000 Subject: [PATCH] Remove nolint:dupl causing lint errors --- mapper.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mapper.go b/mapper.go index 65f9814..a110be0 100644 --- a/mapper.go +++ b/mapper.go @@ -223,8 +223,8 @@ func (r *Registry) RegisterKind(kind reflect.Kind, mapper Mapper) *Registry { // // eg. // -// Mapper string `kong:"type='colour'` -// registry.RegisterName("colour", ...) +// Mapper string `kong:"type='colour'` +// registry.RegisterName("colour", ...) func (r *Registry) RegisterName(name string, mapper Mapper) *Registry { r.names[name] = mapper return r @@ -352,7 +352,7 @@ func timeDecoder() MapperFunc { } } -func intDecoder(bits int) MapperFunc { // nolint: dupl +func intDecoder(bits int) MapperFunc { return func(ctx *DecodeContext, target reflect.Value) error { t, err := ctx.Scan.PopValue("int") if err != nil { @@ -381,7 +381,7 @@ func intDecoder(bits int) MapperFunc { // nolint: dupl } } -func uintDecoder(bits int) MapperFunc { // nolint: dupl +func uintDecoder(bits int) MapperFunc { return func(ctx *DecodeContext, target reflect.Value) error { t, err := ctx.Scan.PopValue("uint") if err != nil { @@ -753,7 +753,7 @@ func urlMapper() MapperFunc { // // It differs from strings.Split() in that the separator can exist in a field by escaping it with a \. eg. // -// SplitEscaped(`hello\,there,bob`, ',') == []string{"hello,there", "bob"} +// SplitEscaped(`hello\,there,bob`, ',') == []string{"hello,there", "bob"} func SplitEscaped(s string, sep rune) (out []string) { if sep == -1 { return []string{s} @@ -786,7 +786,7 @@ func SplitEscaped(s string, sep rune) (out []string) { // JoinEscaped joins a slice of strings on sep, but also escapes any instances of sep in the fields with \. eg. // -// JoinEscaped([]string{"hello,there", "bob"}, ',') == `hello\,there,bob` +// JoinEscaped([]string{"hello,there", "bob"}, ',') == `hello\,there,bob` func JoinEscaped(s []string, sep rune) string { escaped := []string{} for _, e := range s {