(s string)
| 30 | var endChar byte = '\x00' |
| 31 | |
| 32 | func SafeString(s string) string { |
| 33 | if len(s) == 0 { |
| 34 | return end |
| 35 | } |
| 36 | if s[len(s)-1] != endChar { |
| 37 | return s + end |
| 38 | } |
| 39 | return s |
| 40 | } |
| 41 | |
| 42 | func SafeStrings(list []string) []string { |
| 43 | for i := range list { |
no outgoing calls
no test coverage detected