summaryrefslogtreecommitdiff
path: root/src/pkg/flag/flag_test.go
AgeCommit message (Collapse)AuthorFilesLines
2011-06-30Imported Upstream version 58upstream/58Ondřej Surý1-24/+35
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý1-0/+7
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý1-3/+3
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý1-11/+4
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-4/+20
2010-04-06flags: better tests.Rob Pike1-7/+93
R=rsc CC=golang-dev http://codereview.appspot.com/864044
2010-03-29Flags: add user-defined flag types. The change is really no code; it's just ↵Rob Pike1-0/+19
publishing the set() method and add() functions. But we rename add() to Var() for consistency. Also rename FlagValue to Value for simplicity. Also, delete the check for multiple settings for a flag. This makes it possible to define a flag that collects values, such as into a slice of strings. type flagVar []string func (f *flagVar) String() string { return fmt.Sprint(v) } func (f *flagVar) Set(value string) bool { if v == nil { v = make(flagVar, 1) } else { nv := make(flagVar, len(v)+1) copy(nv, v) v = nv } v[len(v)-1] = value return true } var v flagVar func main() { flag.Var(&v, "testV", "multiple values build []string") flag.Parse() fmt.Printf("v = %v\n", v) } R=rsc CC=golang-dev http://codereview.appspot.com/842041
2009-12-15 1) Change default gofmt default settings forRobert Griesemer1-32/+32
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 2nd set of files. R=rsc CC=golang-dev http://codereview.appspot.com/179067
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-7/+7
R=rsc, r http://go/go-review/1025029
2009-11-07Add flags of type float to the flag package.Vish Subramanian1-2/+6
R=r, rsc http://go/go-review/1026011 Committer: Rob Pike <r@golang.org>
2009-11-05gofmt-ify template, time, unsafe, flag, fmtRobert Griesemer1-2/+2
(replacement for CLs 1017039, 1017041, 1017040, 1018054) R=r http://go/go-review/1018060
2009-10-06apply gofmt to datafmt, ebnf, exec, expvar, flag, fmtRuss Cox1-15/+15
R=gri DELTA=456 (6 added, 3 deleted, 447 changed) OCL=35398 CL=35406
2009-09-17unused importsRuss Cox1-1/+0
R=r OCL=34731 CL=34731
2009-08-12convert low-level (used by testing) packages toRuss Cox1-24/+24
whole-package compilation. new Makefiles, tests now in separate package bytes flag fmt io math once os reflect strconv sync time utf8 delete import "xxx" in package xxx. inside package xxx, xxx is not declared anymore so s/xxx.//g delete file and package level forward declarations. note the new internal_test.go and sync and strconv to provide public access to internals during testing. the installed version of the package omits that file and thus does not open the internals to all clients. R=r OCL=33065 CL=33097
2009-06-09mv src/lib to src/pkgRob Pike1-0/+77
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102