refactoring, clean up, v0.17

This commit is contained in:
Chris Lu
2012-09-03 15:41:24 -07:00
parent cdd64a8099
commit 09542d82b4
9 changed files with 111 additions and 77 deletions

View File

@@ -0,0 +1,16 @@
package util
import (
"strconv"
)
func ParseInt(text string, defaultValue int) int{
count, parseError := strconv.ParseUint(text,10,64)
if parseError!=nil {
if len(text)>0{
return 0
}
return defaultValue
}
return int(count)
}