aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/flag/flag.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-12-03 02:17:34 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-12-03 02:17:34 +0000
commit2fd401c8f190f1fe43e51a7f726f6ed6119a1f96 (patch)
tree7f76eff391f37fe6467ff4ffbc0c582c9959ea30 /libgo/go/flag/flag.go
parent02e9018f1616b23f1276151797216717b3564202 (diff)
downloadgcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.zip
gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.gz
gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.bz2
libgo: Update to weekly.2011-11-02.
From-SVN: r181964
Diffstat (limited to 'libgo/go/flag/flag.go')
-rw-r--r--libgo/go/flag/flag.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/libgo/go/flag/flag.go b/libgo/go/flag/flag.go
index f13f7a4..9f115d5 100644
--- a/libgo/go/flag/flag.go
+++ b/libgo/go/flag/flag.go
@@ -60,6 +60,7 @@
package flag
import (
+ "errors"
"fmt"
"os"
"sort"
@@ -67,7 +68,7 @@ import (
)
// ErrHelp is the error returned if the flag -help is invoked but no such flag is defined.
-var ErrHelp = os.NewError("flag: help requested")
+var ErrHelp = errors.New("flag: help requested")
// -- Bool Value
type boolValue bool
@@ -580,7 +581,7 @@ func Var(value Value, name string, usage string) {
// failf prints to standard error a formatted error and usage message and
// returns the error.
-func (f *FlagSet) failf(format string, a ...interface{}) os.Error {
+func (f *FlagSet) failf(format string, a ...interface{}) error {
err := fmt.Errorf(format, a...)
fmt.Fprintln(os.Stderr, err)
f.usage()
@@ -600,7 +601,7 @@ func (f *FlagSet) usage() {
}
// parseOne parses one flag. It returns whether a flag was seen.
-func (f *FlagSet) parseOne() (bool, os.Error) {
+func (f *FlagSet) parseOne() (bool, error) {
if len(f.args) == 0 {
return false, nil
}
@@ -676,7 +677,7 @@ func (f *FlagSet) parseOne() (bool, os.Error) {
// include the command name. Must be called after all flags in the FlagSet
// are defined and before flags are accessed by the program.
// The return value will be ErrHelp if -help was set but not defined.
-func (f *FlagSet) Parse(arguments []string) os.Error {
+func (f *FlagSet) Parse(arguments []string) error {
f.parsed = true
f.args = arguments
for {