1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-03 15:02:35 +02:00

Fix bug in replacement function

This commit is contained in:
OliverNocon 2019-11-06 10:32:02 +01:00
parent deb965e2b4
commit 57540d3127
2 changed files with 2 additions and 1 deletions

View File

@ -295,7 +295,7 @@ func longName(long string) string {
func golangName(name string) string {
properName := strings.Replace(name, "Api", "API", -1)
properName = strings.Replace(name, "api", "API", -1)
properName = strings.Replace(properName, "api", "API", -1)
properName = strings.Replace(properName, "Url", "URL", -1)
properName = strings.Replace(properName, "Id", "ID", -1)
properName = strings.Replace(properName, "Json", "JSON", -1)

View File

@ -203,6 +203,7 @@ func TestGolangName(t *testing.T) {
expected string
}{
{input: "testApi", expected: "TestAPI"},
{input: "apiTest", expected: "APITest"},
{input: "testUrl", expected: "TestURL"},
{input: "testId", expected: "TestID"},
{input: "testJson", expected: "TestJSON"},