|
@@ -64,15 +64,18 @@ func UpperShort(s string) string {
|
|
|
|
|
|
func Id(s string) string {
|
|
func Id(s string) string {
|
|
if strings.HasSuffix(s, "ID") {
|
|
if strings.HasSuffix(s, "ID") {
|
|
- return strings.ReplaceAll(s, "ID", "Id")
|
|
|
|
|
|
+ index := strings.LastIndex(s, "ID")
|
|
|
|
+ return s[0:index] + "Id"
|
|
}
|
|
}
|
|
|
|
|
|
if strings.HasSuffix(s, "id") {
|
|
if strings.HasSuffix(s, "id") {
|
|
- return strings.ReplaceAll(s, "id", "Id")
|
|
|
|
|
|
+ index := strings.LastIndex(s, "id")
|
|
|
|
+ return s[0:index] + "Id"
|
|
}
|
|
}
|
|
|
|
|
|
if strings.HasSuffix(s, "iD") {
|
|
if strings.HasSuffix(s, "iD") {
|
|
- return strings.ReplaceAll(s, "iD", "Id")
|
|
|
|
|
|
+ index := strings.LastIndex(s, "iD")
|
|
|
|
+ return s[0:index] + "Id"
|
|
}
|
|
}
|
|
|
|
|
|
return s
|
|
return s
|
|
@@ -80,15 +83,18 @@ func Id(s string) string {
|
|
|
|
|
|
func ID(s string) string {
|
|
func ID(s string) string {
|
|
if strings.HasSuffix(s, "Id") {
|
|
if strings.HasSuffix(s, "Id") {
|
|
- return strings.ReplaceAll(s, "Id", "ID")
|
|
|
|
|
|
+ index := strings.LastIndex(s, "Id")
|
|
|
|
+ return s[0:index] + "ID"
|
|
}
|
|
}
|
|
|
|
|
|
if strings.HasSuffix(s, "id") {
|
|
if strings.HasSuffix(s, "id") {
|
|
- return strings.ReplaceAll(s, "id", "ID")
|
|
|
|
|
|
+ index := strings.LastIndex(s, "id")
|
|
|
|
+ return s[0:index] + "ID"
|
|
}
|
|
}
|
|
|
|
|
|
if strings.HasSuffix(s, "iD") {
|
|
if strings.HasSuffix(s, "iD") {
|
|
- return strings.ReplaceAll(s, "iD", "ID")
|
|
|
|
|
|
+ index := strings.LastIndex(s, "iD")
|
|
|
|
+ return s[0:index] + "ID"
|
|
}
|
|
}
|
|
|
|
|
|
return s
|
|
return s
|
|
@@ -96,15 +102,18 @@ func ID(s string) string {
|
|
|
|
|
|
func id(s string) string {
|
|
func id(s string) string {
|
|
if strings.HasSuffix(s, "Id") {
|
|
if strings.HasSuffix(s, "Id") {
|
|
- return strings.ReplaceAll(s, "Id", "id")
|
|
|
|
|
|
+ index := strings.LastIndex(s, "Id")
|
|
|
|
+ return s[0:index] + "id"
|
|
}
|
|
}
|
|
|
|
|
|
if strings.HasSuffix(s, "ID") {
|
|
if strings.HasSuffix(s, "ID") {
|
|
- return strings.ReplaceAll(s, "ID", "id")
|
|
|
|
|
|
+ index := strings.LastIndex(s, "ID")
|
|
|
|
+ return s[0:index] + "id"
|
|
}
|
|
}
|
|
|
|
|
|
if strings.HasSuffix(s, "iD") {
|
|
if strings.HasSuffix(s, "iD") {
|
|
- return strings.ReplaceAll(s, "iD", "id")
|
|
|
|
|
|
+ index := strings.LastIndex(s, "iD")
|
|
|
|
+ return s[0:index] + "id"
|
|
}
|
|
}
|
|
|
|
|
|
return s
|
|
return s
|