summaryrefslogtreecommitdiff
path: root/src/pkg/go
AgeCommit message (Collapse)AuthorFilesLines
2011-04-28Imported Upstream version 2011.04.27upstream/2011.04.27Ondřej Surý9-17/+22
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý44-857/+3396
2011-04-20Imported Upstream version 2011.03.07.1upstream/2011.03.07.1Ondřej Surý10-73/+106
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý5-170/+370
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý15-144/+279
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý42-1665/+4296
2010-07-01strings and bytes.Split: make count of 0 mean 0, not infinite.Rob Pike1-1/+1
Use a count of -1 for infinity. Ditto for Replace. R=rsc CC=golang-dev http://codereview.appspot.com/1704044 Committer: Rob Pike <r@golang.org>
2010-06-09go/scanner: report illegal escape sequencesRobert Griesemer1-20/+29
R=golang-dev, r CC=golang-dev http://codereview.appspot.com/1636043
2010-06-08go/printer: deleted dead codeRobert Griesemer2-23/+14
(remains of the semicolon conversion) R=rsc CC=golang-dev http://codereview.appspot.com/1623041
2010-06-08go/parser: correct position of empty statement ';'Robert Griesemer3-10/+9
(caused certain files to not be idempotent under gofmt) - corrected golden files for go/printer - slightly simplified some code in nodes.go (no impact on formatting) - these changes have no impact on gofmt output of .go files under src, misc fallthrough statement considered harmful! R=rsc CC=golang-dev http://codereview.appspot.com/1593042
2010-05-27changes &x -> x[0:] for array to slice conversionRuss Cox1-1/+1
R=gri CC=golang-dev http://codereview.appspot.com/1326042
2010-05-26godoc: collect package comments from all package files, not just the first ↵Robert Griesemer1-6/+23
one found R=r CC=golang-dev http://codereview.appspot.com/1331041
2010-05-21go/printer, gofmt: fix printing of labels,Robert Griesemer4-16/+45
apply gofmt to src, misc Fixes issue 752. R=rsc CC=golang-dev http://codereview.appspot.com/1240044 Committer: Robert Griesemer <gri@golang.org>
2010-05-14go/printer (gofmt): don't lose mandatory semicolonsRobert Griesemer4-17/+59
Fixes issue 779. R=r CC=golang-dev http://codereview.appspot.com/1218042
2010-04-27fix buildRobert Griesemer1-1/+1
R=r CC=golang-dev http://codereview.appspot.com/989044
2010-04-27gofmt: fine-tune stripping of parenthesesRobert Griesemer3-46/+96
(composite literals in control clauses only need parentheses if the literals start with a type name) R=rsc CC=golang-dev http://codereview.appspot.com/962045
2010-04-27go/parser: don't require parens around composite literals inside a composite ↵Robert Griesemer2-0/+5
literal within an if, for, or switch control clause R=rsc CC=golang-dev http://codereview.appspot.com/943046
2010-04-27gofmt: don't strip mandatory ()'s around composite literals in control clausesRobert Griesemer3-7/+73
Fixes issue 748. R=rsc CC=golang-dev http://codereview.appspot.com/946043
2010-04-15go/ast: Update comment to mention imaginary literalsEvan Shaw1-1/+1
R=gri CC=golang-dev http://codereview.appspot.com/846050 Committer: Robert Griesemer <gri@golang.org>
2010-04-15"godoc -src pkg_name" excludes duplicates entriesAndrei Vieru1-9/+15
$ godoc xml | grep Copy\(\) func (c CharData) Copy() CharData func (c Comment) Copy() Comment func (d Directive) Copy() Directive func (p ProcInst) Copy() ProcInst func (e StartElement) Copy() StartElement -------------------------------------------- $ godoc -src xml | grep Copy\(\) func (c CharData) Copy() CharData -------------------------------------------- $ godoc -src xml Copy func (c CharData) Copy() CharData { return CharData(makeCopy(c)) } -------------------------------------------- The command "godoc -src pkg_name" should output the interface of the named package, but it excludes all duplicate entries. Also the command "godoc -src pkg_name method_name" will output the source code only for one method even if there are more of them with the same name in the same package. This patch set fixes this issue. R=gri CC=golang-dev http://codereview.appspot.com/883051 Committer: Robert Griesemer <gri@golang.org>
2010-04-09rename os.Dir to os.FileInfoRob Pike2-3/+3
R=rsc CC=golang-dev http://codereview.appspot.com/902042
2010-03-30go/printer: follow-up on CL 802043Robert Griesemer5-23/+87
- more test cases - comment fixes - minor unrelated changes as part of investigation of issue 702 R=rsc CC=golang-dev http://codereview.appspot.com/860041
2010-03-30Gofmt preserves newlines in multiline selector expressions.Risto Jaakko Saarelma4-6/+298
This is for making the fluent interface idiom usable with gofmt. R=gri CC=golang-dev http://codereview.appspot.com/802043 Committer: Robert Griesemer <gri@golang.org>
2010-03-30simplify various code using new map index ruleRuss Cox1-2/+2
R=r CC=golang-dev http://codereview.appspot.com/833044
2010-03-30single argument panicRuss Cox3-5/+4
note that sortmain.go has been run through hg gofmt; only the formatting of the day initializers changed. i'm happy to revert that formatting if you'd prefer. stop on error in doc/progs/run R=r CC=golang-dev http://codereview.appspot.com/850041
2010-03-29go/printer: fix a commentRobert Griesemer1-1/+1
R=rsc CC=golang-dev http://codereview.appspot.com/826042
2010-03-29godoc: support for filtering of command-line output in -src modeRobert Griesemer1-41/+20
+ various minor cleanups Usage: godoc -src math Sin R=rsc CC=golang-dev http://codereview.appspot.com/791041
2010-03-29go/ast: generalized ast filteringRobert Griesemer2-26/+129
R=rsc CC=golang-dev http://codereview.appspot.com/788041
2010-03-26bytes, strings: IndexOfAnyRobert Griesemer1-9/+2
+ first use in go/doc R=r CC=golang-dev http://codereview.appspot.com/781041
2010-03-25godoc: don't convert multi-line functions into one-liners by defaultRobert Griesemer9-64/+150
- new heuristic: if both the opening { and closing } braces are on the same line, and the function body doesn't contain comments or is other- wise too long (e.g. signature too long), it is formatted as a one-line function - related cleanups along the way - gofmt -w src misc led to no additional changes as expected R=rsc, rsc1 CC=golang-dev, ken2, r http://codereview.appspot.com/758041
2010-03-23fix build - unused importRuss Cox1-1/+0
R=gri CC=golang-dev http://codereview.appspot.com/711041
2010-03-23go/printer: avoid reflect in printRuss Cox1-7/+5
R=gri CC=golang-dev http://codereview.appspot.com/704041
2010-03-23ast/printer: support for printing ast.Spec nodesAndrew Gerrand1-0/+3
R=gri CC=golang-dev http://codereview.appspot.com/682041
2010-03-19godoc: improved comment formatting: recognize URLsRobert Griesemer1-39/+135
and highlight special words, if provided. Also: - related cleanups in src/pkg/go/doc/comment.go - fix typos in src/cmd/goinstall/doc.go Fixes issue 672. R=rsc CC=adg, golang-dev http://codereview.appspot.com/601042
2010-03-18go/doc cleanup: remove some unnecessary string conversionsRobert Griesemer1-3/+2
R=rsc CC=golang-dev http://codereview.appspot.com/642041
2010-03-16gofmt: more consistent formatting of const/var declsRobert Griesemer10-55/+105
- gofmt -w src misc - only manually modified file: src/pkg/go/printer/nodes.go R=rsc CC=golang-dev, r http://codereview.appspot.com/606041
2010-03-16godoc: initial support for showing popup informationRobert Griesemer1-0/+13
for identifiers in Go source code - at the moment just show identifier kind (var, func, etc.) and name (eventually should show declaration, type, etc.) - JavaScript parts by adg R=rsc CC=adg, golang-dev http://codereview.appspot.com/578042
2010-03-12gofmt: make sure there is a newline afterRobert Griesemer5-19/+30
a /*-style comment at the end of a file Some minor cleanups/typo fixes along the way. Fixes an issue where that newline was removed after applying gofmt. R=r CC=golang-dev http://codereview.appspot.com/476043
2010-03-12go/printer: fix a couple of hidden crashes that becomeRobert Griesemer5-3/+20
visible only when enabling internal debug mode: - in rare cases expression depth can underflow - when printing a single labeled statement, indentation may underflow if not setup correctly R=rsc CC=golang-dev http://codereview.appspot.com/484041
2010-03-11ast/filter.go: missing nil-check causes crashRobert Griesemer1-1/+1
R=rsc CC=golang-dev http://codereview.appspot.com/461041
2010-03-11godoc: fix formatting of -src outputRobert Griesemer2-12/+122
- go/filter.go: make MergePackageFiles smarter - go/printer.go: handle positions from multiple files R=rsc CC=golang-dev http://codereview.appspot.com/460042
2010-03-05godoc: don't throw away function documentationRobert Griesemer1-4/+22
if there are multiple functions (for a package, type) with the same name Fixes issue 642. R=rsc CC=golang-dev http://codereview.appspot.com/243041
2010-03-04gofmt: modified algorithm for alignment of multi-line composite/list entriesRobert Griesemer3-24/+117
- only manual changes are in src/pkg/go/printer/nodes.go - use a heuristic to determine "outliers" such that not entire composites are forced to align with them - improves several places that were not unligned before due too simple heuristic - unalignes some cases that contain "outliers" - gofmt -w src misc Fixes issue 644. R=rsc, r CC=golang-dev http://codereview.appspot.com/241041
2010-03-02gofmt: fix alignment of multi-line var declarationsRobert Griesemer3-20/+68
- gofmt -w src misc R=rsc, r CC=golang-dev http://codereview.appspot.com/223101
2010-03-02gofmt: experiment: align values in map composites where possibleRobert Griesemer5-176/+210
- gofmt -w src misc - looking for feedback R=rsc, r CC=golang-dev http://codereview.appspot.com/223076
2010-02-26go/parser cleanup: remove some state by writing more functional codeRobert Griesemer1-16/+17
R=rsc CC=golang-dev http://codereview.appspot.com/223071
2010-02-26go/scanner: the position of '\n's chars must be the last position of the ↵Robert Griesemer2-8/+12
current line Background: This didn't matter until recently, because '\n' don't appear as token starts in source code and thus the exact position was irrelevant (and set as was easiest in the code). With auto semicolon insertion, a virtual semicolon may be inserted when a '\n' is seen. The position of the semicolon is the position of the '\n'. Without this fix, these semicolons appeared on the next line instead of the line where they were inserted. This affected the association of comments to declarations in the parser. As a result, some lead comments where considered line comments, not collected in the ast, and not shown in godoc pages. (This affected only godoc pages, not gofmt-formatted programs). Fixes issue 592. R=rsc CC=golang-dev http://codereview.appspot.com/224068
2010-02-25use []byte("abc") in place of []byte{'a', 'b', 'c'}Russ Cox2-2/+2
R=gri CC=golang-dev http://codereview.appspot.com/223059
2010-02-25go/printer, gofmt: align comments in multi-line expression listsRobert Griesemer6-26/+74
- gofmt -w src misc - improves several lists and fixes minor degradation introduced with the fix for issue 628 - removed some dead code (stringList) R=rsc CC=golang-dev http://codereview.appspot.com/223058
2010-02-25strings: delete Runes, BytesRuss Cox5-31/+27
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev http://codereview.appspot.com/224062