Skip to content

Commit

Permalink
Remove nolint:dupl causing lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
keilin-anz committed Nov 17, 2022
1 parent 0b7fcc0 commit 7df777e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mapper.go
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7df777e

Please sign in to comment.