id作为关键字符转为全大写ID, 而不是Id
This commit is contained in:
parent
4652955c2a
commit
c97a3b3bcb
@ -71,6 +71,11 @@ func SnakeCaseToCamel(str string) string {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 将ID转为大写
|
||||||
|
if str[i] == 'd' && i-1 >= 0 && (str[i-1] == 'i' || str[i-1] == 'I') && (i+1 == len(str) || i+1 < len(str) && str[i+1] == '_') {
|
||||||
|
builder.WriteByte('d' - ('a' - 'A'))
|
||||||
|
continue
|
||||||
|
}
|
||||||
builder.WriteByte(str[i])
|
builder.WriteByte(str[i])
|
||||||
}
|
}
|
||||||
return builder.String()
|
return builder.String()
|
||||||
|
Loading…
Reference in New Issue
Block a user