unsafeGetBytes converts string to byte slice.
(s string)
| 49 | |
| 50 | // unsafeGetBytes converts string to byte slice. |
| 51 | func unsafeGetBytes(s string) []byte { |
| 52 | if len(s) == 0 { |
| 53 | return emptyByteSlice |
| 54 | } |
| 55 | return (*[0x7fff0000]byte)(unsafe.Pointer( |
| 56 | (*reflect.StringHeader)(unsafe.Pointer(&s)).Data), |
| 57 | )[:len(s):len(s)] |
| 58 | } |
| 59 | |
| 60 | func SnakeCase(camel string) string { |
| 61 | var buf bytes.Buffer |
no outgoing calls
no test coverage detected