mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
e6f0375f64
IO redirections use os module now, which uses uintptr for fd.
13 lines
274 B
Go
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
|
|
}
|