High speed scan on Ubuntu/Debian

This commit is contained in:
Kota Kanbe
2016-09-08 19:18:49 +09:00
parent 2afe2d2640
commit dd1d3a05fa
25 changed files with 1035 additions and 317 deletions

View File

@@ -124,3 +124,14 @@ func PrependProxyEnv(cmd string) string {
// }
// return time.Unix(i, 0), nil
// }
// Truncate truncates string to the length
func Truncate(str string, length int) string {
if length < 0 {
return str
}
if length <= len(str) {
return str[:length]
}
return str
}