| Lib | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | - | - | - | - |
| ettle/strcase | goo_id | goo-id | GooId | gooId |
| gobeam/stringy | Goo_ID | Goo-ID | GooID | |
| stoewer/go-strcase | goo_id | goo-id | GooId | gooId |
| iancoleman/strcase | goo_id | goo-id | GooID | gooID |
| pascaldekloe/name | goo_ID | GooID | gooID | |
| nikitaksv/strcase | goo_id | goo-id | GooId | gooId |
| mantidtech/wordcase | goo_id | goo-id | GooID | gooID |
| dc0d/caseconv | goo_id | goo-id | GooId | gooId |
| parithiban/stringcases | goo_i_d | goo-i-d | GooID | gooID |
| HTTPStatusCode | - | - | - | - |
| ettle/strcase | http_status_code | http-status-code | HttpStatusCode | httpStatusCode |
| gobeam/stringy | HTTPStatus_Code | HTTPStatus-Code | HTTPStatusCode | |
| stoewer/go-strcase | http_status_code | http-status-code | HttpstatusCode | httpstatusCode |
| iancoleman/strcase | http_status_code | http-status-code | HTTPStatusCode | hTTPStatusCode |
| pascaldekloe/name | HTTP_status_code | HTTPStatusCode | hTTPStatusCode | |
| nikitaksv/strcase | httpstatus_code | httpstatus-code | HttpstatusCode | httpstatusCode |
| mantidtech/wordcase | http_status_code | http-status-code | HTTPStatusCode | httpStatusCode |
| dc0d/caseconv | http_status_code | http-status-code | HttpStatusCode | httpStatusCode |
| parithiban/stringcases | h_t_t_p_status_code | h-t-t-p-status-code | HTTPStatusCode | hTTPStatusCode |
| FooBAR | - | - | - | - |
| ettle/strcase | foo_bar | foo-bar | FooBar | fooBar |
| gobeam/stringy | Foo_BAR | Foo-BAR | FooBAR | |
| stoewer/go-strcase | foo_bar | foo-bar | FooBar | fooBar |
| iancoleman/strcase | foo_bar | foo-bar | FooBAR | fooBAR |
| pascaldekloe/name | foo_BAR | FooBAR | fooBAR | |
| nikitaksv/strcase | foo_bar | foo-bar | FooBar | fooBar |
| mantidtech/wordcase | foo_bar | foo-bar | FooBar | fooBar |
| dc0d/caseconv | foo_bar | foo-bar | FooBar | fooBar |
| parithiban/stringcases | foo_b_a_r | foo-b-a-r | FooBAR | fooBAR |
| URL | - | - | - | - |
| ettle/strcase | url | url | Url | url |
| gobeam/stringy | URL | URL | URL | |
| stoewer/go-strcase | url | url | Url | url |
| iancoleman/strcase | url | url | URL | uRL |
| pascaldekloe/name | URL | URL | uRL | |
| nikitaksv/strcase | url | url | Url | url |
| mantidtech/wordcase | url | url | URL | url |
| dc0d/caseconv | url | url | Url | url |
| parithiban/stringcases | u_r_l | u-r-l | URL | uRL |
| ID | - | - | - | - |
| ettle/strcase | id | id | Id | id |
| gobeam/stringy | ID | ID | ID | |
| stoewer/go-strcase | id | id | Id | id |
| iancoleman/strcase | id | id | Id | id |
| pascaldekloe/name | ID | ID | iD | |
| nikitaksv/strcase | id | id | Id | id |
| mantidtech/wordcase | id | id | ID | id |
| dc0d/caseconv | id | id | Id | id |
| parithiban/stringcases | i_d | i-d | ID | iD |
| hostIP | - | - | - | - |
| ettle/strcase | host_ip | host-ip | HostIp | hostIp |
| gobeam/stringy | host_IP | host-IP | HostIP | |
| stoewer/go-strcase | host_ip | host-ip | HostIp | hostIp |
| iancoleman/strcase | host_ip | host-ip | HostIP | hostIP |
| pascaldekloe/name | host_IP | HostIP | hostIP | |
| nikitaksv/strcase | host_ip | host-ip | HostIp | hostIp |
| mantidtech/wordcase | host_ip | host-ip | HostIP | hostIP |
| dc0d/caseconv | host_ip | host-ip | HostIp | hostIp |
| parithiban/stringcases | host_i_p | host-i-p | HostIP | hostIP |
| JSON | - | - | - | - |
| ettle/strcase | json | json | Json | json |
| gobeam/stringy | JSON | JSON | JSON | |
| stoewer/go-strcase | json | json | Json | json |
| iancoleman/strcase | json | json | JSON | jSON |
| pascaldekloe/name | JSON | JSON | jSON | |
| nikitaksv/strcase | json | json | Json | json |
| mantidtech/wordcase | json | json | JSON | json |
| dc0d/caseconv | json | json | Json | json |
| parithiban/stringcases | j_s_o_n | j-s-o-n | JSON | jSON |
| JSONName | - | - | - | - |
| ettle/strcase | json_name | json-name | JsonName | jsonName |
| gobeam/stringy | JSONName | JSONName | JSONName | |
| stoewer/go-strcase | json_name | json-name | Jsonname | jsonname |
| iancoleman/strcase | json_name | json-name | JSONName | jSONName |
| pascaldekloe/name | JSON_name | JSONName | jSONName | |
| nikitaksv/strcase | jsonname | jsonname | Jsonname | jsonname |
| mantidtech/wordcase | json_name | json-name | JSONName | jsonName |
| dc0d/caseconv | json_name | json-name | JsonName | jsonName |
| parithiban/stringcases | j_s_o_n_name | j-s-o-n-name | JSONName | jSONName |
| NameJSON | - | - | - | - |
| ettle/strcase | name_json | name-json | NameJson | nameJson |
| gobeam/stringy | Name_JSON | Name-JSON | NameJSON | |
| stoewer/go-strcase | name_json | name-json | NameJson | nameJson |
| iancoleman/strcase | name_json | name-json | NameJSON | nameJSON |
| pascaldekloe/name | name_JSON | NameJSON | nameJSON | |
| nikitaksv/strcase | name_json | name-json | NameJson | nameJson |
| mantidtech/wordcase | name_json | name-json | NameJSON | nameJSON |
| dc0d/caseconv | name_json | name-json | NameJson | nameJson |
| parithiban/stringcases | name_j_s_o_n | name-j-s-o-n | NameJSON | nameJSON |
| UneTête | - | - | - | - |
| ettle/strcase | une_tête | une-tête | UneTête | uneTête |
| gobeam/stringy | Une_Tête | Une-Tête | UneTête | |
| stoewer/go-strcase | une_tête | une-tête | UneTête | uneTête |
| iancoleman/strcase | une_tête | une-tête | UneTte | uneTte |
| pascaldekloe/name | une_tête | UneTête | uneTête | |
| nikitaksv/strcase | une_tête | une-tête | UneTête | uneTête |
| mantidtech/wordcase | une_tête | une-tête | UneTête | uneTête |
| dc0d/caseconv | une_tête | une-tête | UneTête | uneTête |
| parithiban/stringcases | une_tête | une-tête | UneTête | uneTête |
| Source | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | goo_id | goo-id | GooId | gooId |
| HTTPStatusCode | http_status_code | http-status-code | HttpStatusCode | httpStatusCode |
| FooBAR | foo_bar | foo-bar | FooBar | fooBar |
| URL | url | url | Url | url |
| ID | id | id | Id | id |
| hostIP | host_ip | host-ip | HostIp | hostIp |
| JSON | json | json | Json | json |
| JSONName | json_name | json-name | JsonName | jsonName |
| NameJSON | name_json | name-json | NameJson | nameJson |
| UneTête | une_tête | une-tête | UneTête | uneTête |
| Source | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | Goo_ID | Goo-ID | GooID | |
| HTTPStatusCode | HTTPStatus_Code | HTTPStatus-Code | HTTPStatusCode | |
| FooBAR | Foo_BAR | Foo-BAR | FooBAR | |
| URL | URL | URL | URL | |
| ID | ID | ID | ID | |
| hostIP | host_IP | host-IP | HostIP | |
| JSON | JSON | JSON | JSON | |
| JSONName | JSONName | JSONName | JSONName | |
| NameJSON | Name_JSON | Name-JSON | NameJSON | |
| UneTête | Une_Tête | Une-Tête | UneTête |
| Source | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | goo_id | goo-id | GooId | gooId |
| HTTPStatusCode | http_status_code | http-status-code | HttpstatusCode | httpstatusCode |
| FooBAR | foo_bar | foo-bar | FooBar | fooBar |
| URL | url | url | Url | url |
| ID | id | id | Id | id |
| hostIP | host_ip | host-ip | HostIp | hostIp |
| JSON | json | json | Json | json |
| JSONName | json_name | json-name | Jsonname | jsonname |
| NameJSON | name_json | name-json | NameJson | nameJson |
| UneTête | une_tête | une-tête | UneTête | uneTête |
| Source | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | goo_id | goo-id | GooID | gooID |
| HTTPStatusCode | http_status_code | http-status-code | HTTPStatusCode | hTTPStatusCode |
| FooBAR | foo_bar | foo-bar | FooBAR | fooBAR |
| URL | url | url | URL | uRL |
| ID | id | id | Id | id |
| hostIP | host_ip | host-ip | HostIP | hostIP |
| JSON | json | json | JSON | jSON |
| JSONName | json_name | json-name | JSONName | jSONName |
| NameJSON | name_json | name-json | NameJSON | nameJSON |
| UneTête | une_tête | une-tête | UneTte | uneTte |
| Source | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | goo_ID | GooID | gooID | |
| HTTPStatusCode | HTTP_status_code | HTTPStatusCode | hTTPStatusCode | |
| FooBAR | foo_BAR | FooBAR | fooBAR | |
| URL | URL | URL | uRL | |
| ID | ID | ID | iD | |
| hostIP | host_IP | HostIP | hostIP | |
| JSON | JSON | JSON | jSON | |
| JSONName | JSON_name | JSONName | jSONName | |
| NameJSON | name_JSON | NameJSON | nameJSON | |
| UneTête | une_tête | UneTête | uneTête |
| Source | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | goo_id | goo-id | GooId | gooId |
| HTTPStatusCode | httpstatus_code | httpstatus-code | HttpstatusCode | httpstatusCode |
| FooBAR | foo_bar | foo-bar | FooBar | fooBar |
| URL | url | url | Url | url |
| ID | id | id | Id | id |
| hostIP | host_ip | host-ip | HostIp | hostIp |
| JSON | json | json | Json | json |
| JSONName | jsonname | jsonname | Jsonname | jsonname |
| NameJSON | name_json | name-json | NameJson | nameJson |
| UneTête | une_tête | une-tête | UneTête | uneTête |
| Source | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | goo_id | goo-id | GooID | gooID |
| HTTPStatusCode | http_status_code | http-status-code | HTTPStatusCode | httpStatusCode |
| FooBAR | foo_bar | foo-bar | FooBar | fooBar |
| URL | url | url | URL | url |
| ID | id | id | ID | id |
| hostIP | host_ip | host-ip | HostIP | hostIP |
| JSON | json | json | JSON | json |
| JSONName | json_name | json-name | JSONName | jsonName |
| NameJSON | name_json | name-json | NameJSON | nameJSON |
| UneTête | une_tête | une-tête | UneTête | uneTête |
| Source | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | goo_id | goo-id | GooId | gooId |
| HTTPStatusCode | http_status_code | http-status-code | HttpStatusCode | httpStatusCode |
| FooBAR | foo_bar | foo-bar | FooBar | fooBar |
| URL | url | url | Url | url |
| ID | id | id | Id | id |
| hostIP | host_ip | host-ip | HostIp | hostIp |
| JSON | json | json | Json | json |
| JSONName | json_name | json-name | JsonName | jsonName |
| NameJSON | name_json | name-json | NameJson | nameJson |
| UneTête | une_tête | une-tête | UneTête | uneTête |
| Source | Snake | Kebab | Pascal Case | Camel Case |
|---|---|---|---|---|
| GooID | goo_i_d | goo-i-d | GooID | gooID |
| HTTPStatusCode | h_t_t_p_status_code | h-t-t-p-status-code | HTTPStatusCode | hTTPStatusCode |
| FooBAR | foo_b_a_r | foo-b-a-r | FooBAR | fooBAR |
| URL | u_r_l | u-r-l | URL | uRL |
| ID | i_d | i-d | ID | iD |
| hostIP | host_i_p | host-i-p | HostIP | hostIP |
| JSON | j_s_o_n | j-s-o-n | JSON | jSON |
| JSONName | j_s_o_n_name | j-s-o-n-name | JSONName | jSONName |
| NameJSON | name_j_s_o_n | name-j-s-o-n | NameJSON | nameJSON |
| UneTête | une_tête | une-tête | UneTête | uneTête |
Notes:
- https://github.com/ettle/strcase is able to create names with "Golint Initialisms".
- https://github.com/parithiban/stringcases panics with empty string and a string with only special characters.
https://github.com/ettle/strcase seems to be the library with the best and largest possibilities, at least for my use case.
- https://github.com/ettle/strcase
- https://github.com/gobeam/stringy
- https://github.com/iancoleman/strcase
- https://github.com/mantidtech/wordcase
- https://github.com/nikitaksv/strcase
- https://github.com/parithiban/stringcases
- https://github.com/pascaldekloe/name
- https://github.com/stoewer/go-strcase
others:
https://github.com/golang/lint/blob/83fdc39ff7b56453e3793356bcff3070b9b96445/lint.go#L770-L809
var commonInitialisms = map[string]bool{
"ACL": true,
"API": true,
"ASCII": true,
"CPU": true,
"CSS": true,
"DNS": true,
"EOF": true,
"GUID": true,
"HTML": true,
"HTTP": true,
"HTTPS": true,
"ID": true,
"IP": true,
"JSON": true,
"LHS": true,
"QPS": true,
"RAM": true,
"RHS": true,
"RPC": true,
"SLA": true,
"SMTP": true,
"SQL": true,
"SSH": true,
"TCP": true,
"TLS": true,
"TTL": true,
"UDP": true,
"UI": true,
"UID": true,
"UUID": true,
"URI": true,
"URL": true,
"UTF8": true,
"VM": true,
"XML": true,
"XMPP": true,
"XSRF": true,
"XSS": true,
}