summaryrefslogtreecommitdiff
path: root/int.go
blob: 45186c751c8f23e720af13a6ba21bc655677105c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package shell

/* 
	send it anything, always get back an int
*/

// import "log"
// import "reflect"
// import "strings"
// import "bytes"
import "strconv"

func Int(s string) int {
	s = Chomp(s)
	i, err := strconv.Atoi(s)
	if (err != nil) {
		handleError(err, -1)
		return 0
	}
	return i
}