From fecaf213b8b2204188ef73fdef2df7b08558dbf2 Mon Sep 17 00:00:00 2001 From: Nick Miyake Date: Mon, 10 Sep 2018 14:43:29 -0700 Subject: [PATCH] Update Go to 1.11 (#18) --- .circleci/config.yml | 5 ++-- .../x/lint/amalgomated_flag/flag.go | 24 ++++++++----------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb4aabbf..9af06561 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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 diff --git a/generated_src/internal/golang.org/x/lint/amalgomated_flag/flag.go b/generated_src/internal/golang.org/x/lint/amalgomated_flag/flag.go index edde5282..2cd7829c 100644 --- a/generated_src/internal/golang.org/x/lint/amalgomated_flag/flag.go +++ b/generated_src/internal/golang.org/x/lint/amalgomated_flag/flag.go @@ -5,7 +5,7 @@ /* Package flag implements command-line flag parsing. - Usage: + Usage Define flags using flag.String(), Bool(), Int(), etc. @@ -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 @@ -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. @@ -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 @@ -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,