(path string)
| 1195 | if v != nil { |
| 1196 | return *v |
| 1197 | } |
| 1198 | } |
| 1199 | var zero T |
| 1200 | return zero |
| 1201 | } |
| 1202 | |
| 1203 | func plural(n int) string { |
| 1204 | if n == 1 { |
| 1205 | return "" |
| 1206 | } |
| 1207 | return "s" |
| 1208 | } |
| 1209 | |
| 1210 | func timeSeconds(seconds int) time.Duration { |
| 1211 | return time.Duration(seconds) * time.Second |
| 1212 | } |
| 1213 | |
| 1214 | func decodeToolBytes(data []byte) string { |
| 1215 | if len(data) >= 2 && data[0] == 0xff && data[1] == 0xfe { |
| 1216 | u16 := make([]uint16, 0, len(data)/2) |
| 1217 | for i := 0; i+1 < len(data); i += 2 { |
| 1218 | u16 = append(u16, uint16(data[i])|uint16(data[i+1])<<8) |
| 1219 | } |
| 1220 | runes := utf16.Decode(u16) |
| 1221 | if len(data)%2 == 1 { |
| 1222 | runes = append(runes, '\ufffd') |
| 1223 | } |
no outgoing calls
no test coverage detected