Skip to content

Commit

Permalink
Update Go to 1.11 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmiyake authored Sep 10, 2018
1 parent 6ceb920 commit fecaf21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ working_dir: &working_dir
darwin-linux-no-cgo: &darwin-linux-no-cgo
<<: *working_dir
docker:
- image: nmiyake/go:go-darwin-linux-no-cgo-1.10.1-t127
- image: nmiyake/go:go-darwin-linux-no-cgo-1.11-t133
environment:
CGO_ENABLED: 0

Expand Down Expand Up @@ -45,7 +45,8 @@ go-install-packages: &go-install-packages
run: go install $(./godelw packages)

godelw-verify: &godelw-verify
run: ./godelw verify --apply=false --junit-output="$TESTS_DIR/$CIRCLE_PROJECT_REPONAME-tests.xml"
# TODO: remove "--skip-check" option once checks are re-compiled for Go 1.11
run: ./godelw verify --apply=false --skip-check --junit-output="$TESTS_DIR/$CIRCLE_PROJECT_REPONAME-tests.xml"

store-test-results: &store-test-results
type: test-results-store
Expand Down
24 changes: 10 additions & 14 deletions generated_src/internal/golang.org/x/lint/amalgomated_flag/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
Package flag implements command-line flag parsing.
Usage:
Usage
Define flags using flag.String(), Bool(), Int(), etc.
Expand Down Expand Up @@ -35,7 +35,10 @@
slice flag.Args() or individually as flag.Arg(i).
The arguments are indexed from 0 through flag.NArg()-1.
Command line flag syntax:
Command line flag syntax
The following forms are permitted:
-flag
-flag=x
-flag x // non-boolean flags only
Expand Down Expand Up @@ -395,8 +398,8 @@ func Set(name, value string) error {
return CommandLine.Set(name, value)
}

// isZeroValue guesses whether the string represents the zero
// value for a flag. It is not accurate but in practice works OK.
// isZeroValue determines whether the string represents the zero
// value for a flag.
func isZeroValue(flag *Flag, value string) bool {
// Build a zero value of the flag's Value type, and see if the
// result of calling its String method equals the value passed in.
Expand All @@ -408,15 +411,7 @@ func isZeroValue(flag *Flag, value string) bool {
} else {
z = reflect.Zero(typ)
}
if value == z.Interface().(Value).String() {
return true
}

switch value {
case "false", "", "0":
return true
}
return false
return value == z.Interface().(Value).String()
}

// UnquoteUsage extracts a back-quoted name from the usage
Expand Down Expand Up @@ -981,7 +976,8 @@ func commandLineUsage() {
}

// NewFlagSet returns a new, empty flag set with the specified name and
// error handling property.
// error handling property. If the name is not empty, it will be printed
// in the default usage message and in error messages.
func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {
f := &FlagSet{
name: name,
Expand Down

0 comments on commit fecaf21

Please sign in to comment.