1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:31:22 -06:00
Commit Graph

34 Commits

Author SHA1 Message Date
Nigel Tao
6a186d38d1 src/pkg: make package doc comments consistently start with "Package foo".
R=rsc
CC=golang-dev
https://golang.org/cl/4442064
2011-04-20 09:57:05 +10:00
Rob Pike
7f9acb53cb testing: shorten some more tests
R=rsc
CC=golang-dev
https://golang.org/cl/4314044
2011-03-26 11:25:22 -07:00
Rob Pike
1ce6245d6c throughout: fix broken calls to Printf etc.
I have written a tool to verify Printf calls, and although it's not
ready to be reviewed yet it's already uncovered a spate of problems
in the repository.  I'm sending this CL to break the changes into
pieces; as the tool improves it will find more, I'm sure.

R=rsc
CC=golang-dev
https://golang.org/cl/3427043
2010-12-07 16:42:54 -05:00
Rob Pike
42cfe48ffc use the new %U format for runes
R=rsc
CC=golang-dev
https://golang.org/cl/3483041
2010-12-06 14:38:25 -05:00
Adam Langley
3cb4bdb9ce utf8: make EncodeRune's destination the first argument.
R=r
CC=golang-dev
https://golang.org/cl/3364041
2010-11-30 16:59:43 -05:00
Robert Griesemer
3478891d12 gofmt -s -w src misc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
Rob Pike
b4e358d7e1 utf8.String: provide an Init method to avoid unnecessary allocation
when creating an array of Strings.

R=rsc
CC=golang-dev
https://golang.org/cl/2267046
2010-09-27 12:06:29 -07:00
Rob Pike
2f80d328e8 utf8.String: Slice(i,j)
R=rsc
CC=golang-dev
https://golang.org/cl/2225048
2010-09-25 08:52:29 +10:00
Rob Pike
6f32c82953 utf8: Add new type String to automate string indexing by code point.
R=rsc, rog
CC=golang-dev
https://golang.org/cl/2275041
2010-09-25 06:58:34 +10:00
Roger Peppe
f11271b82e utf8: add DecodeLastRune and DecodeLastRuneInString to
enable traversing rune-by-rune backwards in strings

R=r, rsc
CC=golang-dev
https://golang.org/cl/2192050
2010-09-23 20:33:52 +10:00
Russ Cox
da392d9136 build: no required environment variables
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Russ Cox
bb84f4b5d2 changes &x -> x[0:] for array to slice conversion
R=gri
CC=golang-dev
https://golang.org/cl/1326042
2010-05-27 14:51:47 -07:00
Russ Cox
9750adbbad strings: delete Runes, Bytes
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
https://golang.org/cl/224062
2010-02-25 16:01:29 -08:00
Robert Griesemer
45ca9f7a9e 1) Change default gofmt default settings for
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

5th and last set of files.

R=rsc
CC=golang-dev
https://golang.org/cl/180050
2009-12-15 15:41:46 -08:00
Rob Pike
0d3f5a84b8 simpler fix for the negative rune problem, spotted seconds after submitting the previous fix.
R=rsc
https://golang.org/cl/178044
2009-12-15 09:31:24 +11:00
Rob Pike
a9e8befb49 generate replacement rune when asked to encode a negative rune value.
Fixes #425.

R=rsc
https://golang.org/cl/178043
2009-12-15 09:19:54 +11:00
Rob Pike
b5358e0630 a few utf8 benchmarks. on my mac:
utf8_test.BenchmarkRuneCountTenASCIIChars	20000000	       108 ns/op
utf8_test.BenchmarkRuneCountTenJapaneseChars	10000000	       199 ns/op
utf8_test.BenchmarkEncodeASCIIRune	500000000	         6 ns/op
utf8_test.BenchmarkEncodeJapaneseRune	100000000	        10 ns/op
utf8_test.BenchmarkDecodeASCIIRune	100000000	        13 ns/op
utf8_test.BenchmarkDecodeJapaneseRune	100000000	        21 ns/op

R=gri
CC=golang-dev
https://golang.org/cl/161049
2009-11-25 13:30:30 -08:00
Rob Pike
773e77981d rewrite RuneCountInString to use range.
R=gri
CC=golang-dev
https://golang.org/cl/160069
2009-11-25 11:39:34 -08:00
Sergio Luis O. B. Correia
6fc820729e go: makes it build for the case $GOROOT has whitespaces
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.

this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.

Fixes #115.

R=rsc, dsymonds1
https://golang.org/cl/157067
2009-11-23 17:32:51 -08:00
Russ Cox
9ac4449cb2 gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkg
R=r, gri
CC=golang-dev
https://golang.org/cl/156115
2009-11-20 11:45:05 -08:00
Robert Griesemer
3bb0032cd6 - replaced gofmt expression formatting algorithm with
rsc's algorithm
- applied gofmt -w misc src
- partial CL (last chunk)

R=rsc, r
http://go/go-review/1024041
2009-11-09 21:23:52 -08:00
Robert Griesemer
40621d5c0d remove semis after statements in one-statement statement lists
R=rsc, r
http://go/go-review/1025029
2009-11-09 12:07:39 -08:00
Robert Griesemer
368f8cbc75 - fine-tuning of one-line func heuristic (nodes.go)
- enabled for function declarations (not just function literals)
- applied gofmt -w $GOROOT/src
(look for instance at src/pkg/debug/elf/elf.go)

R=r, rsc
CC=go-dev
http://go/go-review/1026006
2009-11-06 14:24:38 -08:00
Russ Cox
d2829faa7c files that are okay from the last gofmt round
R=gri
http://go/go-review/1015011
2009-10-27 22:47:54 -07:00
Russ Cox
094f1d5990 more lgtm files from gofmt
R=gri
OCL=35485
CL=35488
2009-10-08 15:14:54 -07:00
Russ Cox
91549438d8 apply gofmt to rand reflect regexp rpc runtime sort strconv strings sync syscall testing time unicode unsafe utf8
R=gri
DELTA=1409  (79 added, 24 deleted, 1306 changed)
OCL=35415
CL=35437
2009-10-07 11:55:06 -07:00
Russ Cox
20011bc878 unused imports
R=r
OCL=34731
CL=34731
2009-09-17 10:27:04 -07:00
Russ Cox
ca6a0fee1b more "declared and not used".
the last round omitted := range and only
checked 1 out of N vars in a multi-var :=

R=r
OCL=34624
CL=34638
2009-09-15 09:41:59 -07:00
Russ Cox
28eba4877b fix "declared and not used" errors in non-test code.
R=r
DELTA=112  (6 added, 57 deleted, 49 changed)
OCL=34610
CL=34610
2009-09-14 17:20:29 -07:00
Rob Pike
d80a177a9e make ToUpper, ToLower etc. handle unicode properly.
Change their names too.

R=rsc
DELTA=206  (123 added, 2 deleted, 81 changed)
OCL=34170
CL=34194
2009-09-01 11:06:28 -07:00
Rob Pike
149e3d332c rearrange some constants. unicode package now defines MaxRune and ReplacementChar.
utf8 package imports unicode to get those definitions.
regenerate dependencies.

R=rsc
DELTA=41  (19 added, 3 deleted, 19 changed)
OCL=34123
CL=34129
2009-08-31 13:01:25 -07:00
Russ Cox
3b864e4195 convert low-level (used by testing) packages to
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-08-12 13:18:37 -07:00
Russ Cox
d3a412a5ab io.StringBytes -> strings.Bytes
io.ByteBuffer -> bytes.Buffer

left io.ByteBuffer stub around for now,
for protocol compiler.

R=r
OCL=30861
CL=30872
2009-06-29 15:24:23 -07:00
Rob Pike
d90e7cbac6 mv src/lib to src/pkg
tests: all.bash passes, gobuild still works, godoc still works.

R=rsc
OCL=30096
CL=30102
2009-06-09 09:53:44 -07:00