elvish/parse/strconv.go
Cheer Xiao e6f0375f64 Use uintptr for fd in IO redirections.
IO redirections use os module now, which uses uintptr for fd.
2013-09-19 18:11:01 +08:00

13 lines
274 B
Go

package parse
import (
"strconv"
)
// Atou is basically shorthand for strconv.ParseUint(s, 10, 0) but returns the
// first argument as uintptr. Useful for parsing fd.
func Atou(s string) (uintptr, error) {
u, err := strconv.ParseUint(s, 10, 0)
return uintptr(u), err
}