go-strcase icon indicating copy to clipboard operation
go-strcase copied to clipboard

Bug in camel case conversion

Open standy66 opened this issue 4 years ago • 1 comments

Hi! I found a small bug in UpperCamelCase/LowerCamelCase conversion functions when they are applied on a string "XRequestId". The second letter (R) is not capitalized after conversion. Here is a code to reproduce:

package main

import (
	"fmt"
	"github.com/stoewer/go-strcase"
)

func main() {
	fmt.Println(strcase.UpperCamelCase("XRequestId"))
	fmt.Println(strcase.LowerCamelCase("XRequestId"))
}

Expected output:

XRequestId
xRequestId

What I actually got:

XrequestId
xrequestId

standy66 avatar Apr 29 '20 07:04 standy66

Thanks you @standy66 for the bug report. I'll have a look at it ASAP.

stoewer avatar Apr 29 '20 08:04 stoewer