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:
parent
deb965e2b4
commit
57540d3127
@ -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)
|
||||
|
@ -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"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user