1
0
mirror of https://github.com/golang/go synced 2024-11-06 01:36:10 -07:00
Commit Graph

176 Commits

Author SHA1 Message Date
Rob Pike
9e2fbe186d Effective Go: some small cleanups.
Add discussion of getters.
Add example using a map as a set.

R=golang-dev, gri, adg, iant
CC=golang-dev
https://golang.org/cl/4240100
2011-03-09 16:47:40 -08:00
Rob Pike
6095ff3864 Effective Go: stress that comments are uninterpreted text
that should look in godoc.

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4192041
2011-02-16 22:35:31 -08:00
Rob Pike
fb9e37cd9b template: reverse order of arguments to Execute
In line with other functions such as Fprintf, put the
thing to be written first.

Apologies for the breakages this is sure to cause.

R=rsc, gri, adg, eds, r2, aam
CC=golang-dev
https://golang.org/cl/4169042
2011-02-09 14:23:01 -08:00
Robert Griesemer
76f3228520 go spec, effective go: cleanups
Removed most of the detailed examples about handing panics
from the go spec since it's now covered by Effective Go.

R=r, rsc, iant, ken2
CC=golang-dev
https://golang.org/cl/4128058
2011-02-04 08:43:21 -08:00
Robert Griesemer
bd4e49f524 Effective Go: fix typo
Fixes #1467.

R=r, r2
CC=golang-dev
https://golang.org/cl/3981054
2011-02-02 11:02:56 -08:00
Rob Pike
eea18d959e log: rename Exit* to Fatal*
This aligns the naming scheme with the testing package and
also lets govet work on more logging calls.

R=rsc
CC=golang-dev
https://golang.org/cl/4001048
2011-02-01 12:47:35 -08:00
Rob Pike
61978aa579 effective go: remove non-blocking ops in leaky bucket example
R=rsc
CC=golang-dev
https://golang.org/cl/4029048
2011-01-31 12:46:38 -08:00
Rob Pike
80e25fc923 docs: float->float64 plus a couple of other tweaks.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/3978042
2011-01-19 23:07:38 -05:00
Rob Pike
29d0f02bd2 effective go: explain the effect of repanicking better.
Also fix a <p> error in go_spec.html.

Fixes #1370.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/3835043
2011-01-05 11:39:57 -08:00
Nigel Tao
bf453eba90 doc: update Effective Go for template API change.
The original change 3378041 was submitted in December 2010:
template: change the signature of formatters for future development.

R=adg
CC=golang-dev
https://golang.org/cl/3862041
2011-01-04 15:52:03 +11:00
Kyle Consalus
009aebdba8 Removed bytes.Add and bytes.AddByte; we now have 'append'.
Changed all uses of bytes.Add (aside from those testing bytes.Add) to append(a, b...).
Also ran "gofmt -s" and made use of copy([]byte, string) in the fasta benchmark.

R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/3302042
2010-12-01 11:59:13 -08:00
Rob Pike
70d0b6b242 Effective Go: correct error in recent edit: "..." is in call to Sprintln, not Output.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/2853042
2010-11-03 11:09:43 -07:00
Rob Pike
0808b199e0 Effective Go: append and a few words about ...
R=rsc, gri, iant
CC=golang-dev
https://golang.org/cl/2821041
2010-11-01 21:46:04 -07:00
Rob Pike
e787f8276d Effective Go: update examples to use new logging interface.
R=adg
CC=golang-dev
https://golang.org/cl/2468041
2010-10-12 16:56:50 -07:00
Rob Pike
1edfb4cc75 Effective Go: update for new http interface.
R=rsc, stephenm
CC=golang-dev
https://golang.org/cl/2310041
2010-09-29 11:12:52 -07:00
James Fysh
089ce17093 Documentation: Fix a bug in the example in Constants subsection
Not a bug per-se, the issue is that the fmt.Sprintf method inside the
	ByteSize.String() method ends up calling itself to generate the String
	representation of the ByteSize value.  Infinite loops are bad.

    Updated as per review comments

R=r
CC=golang-dev
https://golang.org/cl/1974046
2010-08-28 07:54:16 +10:00
Rob Pike
7ddbe79842 effective go: fix errors caught by HaWe
R=rsc
CC=golang-dev
https://golang.org/cl/1959043
2010-08-24 12:37:51 +10:00
Christopher Wedgwood
c80746aa90 doc: add missing paren (pointed out by nbjoerg)
R=rsc, r
CC=golang-dev
https://golang.org/cl/1983045
2010-08-19 10:03:58 +10:00
Rob Pike
4fd7880d81 Effective Go: minor change to correct a comment in an example
R=rsc
CC=golang-dev
https://golang.org/cl/1689042
2010-06-18 20:33:03 -07:00
Rob Pike
99b23a1e5b Effective Go: panic and recover
R=rsc, iant
CC=golang-dev
https://golang.org/cl/1718042
2010-06-18 10:52:37 -07:00
Rob Pike
050905b985 Effective Go: add a section on defer.
R=rsc, iant
CC=golang-dev
https://golang.org/cl/1694044
2010-06-16 13:47:36 -07:00
Rob Pike
6c08859b0e Effective Go: update ... discussion.
R=rsc
CC=golang-dev
https://golang.org/cl/1698041
2010-06-14 22:40:35 -07:00
Ian Lance Taylor
cd242fb480 Use the copy function rather than a loop.
R=r
CC=golang-dev
https://golang.org/cl/882047
2010-04-13 13:05:29 -07:00
Rob Pike
4710642d41 Effective Go: update maps description regarding lookup of nonexistent entry.
R=rsc, gri, iant
CC=golang-dev
https://golang.org/cl/821044
2010-03-30 11:21:50 -07:00
Andrey Mirtchovski
1f3222a57b strings.Bytes -> []byte for documentation example, src/pkg/* comments, and htmlgen.go
R=rsc, adg
CC=golang-dev
https://golang.org/cl/224087
2010-03-02 11:18:22 +11:00
Andrew Gerrand
766c3ff735 effective_go: clarified small comment
R=rsc, cw
CC=golang-dev
https://golang.org/cl/217085
2010-02-22 14:51:22 -08:00
Rob Pike
49a35a632e be more explicit about initialization of embedded fields.
R=rsc
CC=golang-dev
https://golang.org/cl/186161
2010-01-15 11:59:53 +11:00
Rob Pike
c05f86a46a fix up YB and add ZB, EB in example
R=rsc
CC=golang-dev
https://golang.org/cl/183107
2010-01-04 07:36:39 +11:00
Rob Pike
77f6f16660 fix naked < and > as reported by Peter Williams <>
(i thought these were legal in <pre> blocks)

R=rsc
CC=golang-dev, pwil3058
https://golang.org/cl/181055
2009-12-25 07:13:14 +11:00
Rob Pike
617a6a519f fix documentation bug in example
Fixes #452.

R=gri
CC=golang-dev, dougfelt
https://golang.org/cl/181043
2009-12-23 13:47:58 +11:00
Rob Pike
163ecdac1a new semicolon rule in effective_go.html.
eliminate all tab characters while we're here.

R=rsc
CC=golang-dev
https://golang.org/cl/180055
2009-12-16 12:31:18 +11:00
Rob Pike
acf4dd4d56 change the naming example from Vector to Ring due to loss of vector.New()
R=rsc
CC=golang-dev
https://golang.org/cl/164082
2009-12-02 13:46:02 -08:00
Rob Pike
bcb46c8560 fix typo in Append return type
R=rsc
https://golang.org/cl/155058
2009-11-16 21:56:38 -08:00
Adam Langley
4085364a20 doc: fix typo.
Fixes #218

R=r
CC=golang-dev
https://golang.org/cl/155067
2009-11-16 11:56:18 -08:00
Rob Pike
dc3b4932d8 add a paragraph about GOMAXPROCS
R=rsc
CC=golang-dev
https://golang.org/cl/154153
2009-11-15 13:09:43 -08:00
Rob Pike
029c39f45a fix some typos in the documentation
Fixes #196.

R=rsc
https://golang.org/cl/154152
2009-11-15 12:09:59 -08:00
Rob Pike
0c83f23d44 fix typo in ByteSize example
R=rsc, agl1
CC=golang-dev
https://golang.org/cl/154076
2009-11-11 19:39:57 -08:00
Russ Cox
ef7c370a20 typo
Fixes #69.

R=r
https://golang.org/cl/152082
2009-11-11 14:52:38 -08:00
Rob Pike
8db6370d78 fix final program to have Html->HTML
R=rsc
CC=go-dev
https://golang.org/cl/152050
2009-11-10 18:24:06 -08:00
Ian Lance Taylor
cc6720aab7 Minor tweaks.
The text changes are trivial and may be ignored, but there are
two code corrections.

R=r, rsc
CC=go-dev
http://go/go-review/1024045
2009-11-10 00:09:53 -08:00
Russ Cox
1a821b32da noted by kaib: explicit assignment initialization
didn't match the composite literal initialization.

R=r
CC=kaib
http://go/go-review/1024039
2009-11-09 17:09:33 -08:00
Russ Cox
24ce19c71d effective go: tiny fixes
one real bug: *[]float -> *[3]float

R=r
http://go/go-review/1024016
2009-11-08 01:07:53 -08:00
Rob Pike
31053d4e47 add a final section with a complete example
R=rsc
CC=go-dev
http://go/go-review/1017033
2009-11-04 17:29:20 -08:00
Rob Pike
c2b6418c26 fixups to "effective go"
R=rsc
CC=go-dev
http://go/go-review/1016020
2009-11-01 20:54:11 -08:00
Rob Pike
bb3e3090c6 concurrency
R=go-dev, iant, rsc
http://go/go-review/1018004
2009-10-31 18:29:06 -07:00
Rob Pike
2cf9dae134 drop a couple of semicolons for consistency
R=rsc
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=35983
CL=35983
2009-10-21 23:05:56 -07:00
Rob Pike
6f89f3f08d initialization
R=rsc
DELTA=292  (124 added, 165 deleted, 3 changed)
OCL=35936
CL=35939
2009-10-20 17:32:16 -07:00
Rob Pike
430d462391 start the concurrency discussion. work from the outside in because this is a toughie.
also fix a pedantry in the language design faq.

R=rsc
DELTA=113  (94 added, 16 deleted, 3 changed)
OCL=35922
CL=35928
2009-10-20 12:30:39 -07:00
Rob Pike
9f60b03610 address leftover post-submit comments about embedding
R=rsc
DELTA=11  (9 added, 0 deleted, 2 changed)
OCL=35872
CL=35872
2009-10-19 10:34:00 -07:00
Rob Pike
f00be0caee more embedding. enough for now?
R=rsc
DELTA=51  (48 added, 0 deleted, 3 changed)
OCL=35846
CL=35853
2009-10-16 16:16:02 -07:00
Rob Pike
c58d9efc63 fix pre-submit editing typo; text is garbled.
R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=35841
CL=35841
2009-10-16 11:23:45 -07:00
Rob Pike
8840726edc embedding part 1.
R=rsc
DELTA=128  (104 added, 0 deleted, 24 changed)
OCL=35835
CL=35839
2009-10-16 11:13:40 -07:00
Rob Pike
ee3e97c778 forgot to update the body when i changed the receiver type.
R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=35759
CL=35761
2009-10-15 00:27:26 -07:00
Rob Pike
2119b3672d interfaces and methods.
R=rsc
DELTA=160  (143 added, 5 deleted, 12 changed)
OCL=35748
CL=35758
2009-10-14 23:03:08 -07:00
Russ Cox
a68592a4dd excise some internal references.
R=r
DELTA=209  (65 added, 114 deleted, 30 changed)
OCL=35718
CL=35721
2009-10-14 13:02:05 -07:00
Rob Pike
b95048f38d some stuff about interfaces. not enough yet.
R=rsc
DELTA=209  (129 added, 24 deleted, 56 changed)
OCL=35675
CL=35680
2009-10-13 14:32:21 -07:00
Rob Pike
d2228692b2 type switches
errors

R=rsc
DELTA=150  (74 added, 34 deleted, 42 changed)
OCL=35647
CL=35650
2009-10-12 21:18:23 -07:00
Rob Pike
9dfe40441e printing and maps
R=rsc,gri
DELTA=228  (223 added, 1 deleted, 4 changed)
OCL=35617
CL=35619
2009-10-12 14:51:12 -07:00
Rob Pike
3e74079151 slices
methods on slices, pointers and values.

R=iant,rsc,gri
DELTA=173  (150 added, 1 deleted, 22 changed)
OCL=35333
CL=35337
2009-10-05 14:48:57 -07:00
Robert Griesemer
53440da835 Factored out boilerplate from all html docs in doc directory:
- the first HTML comment in those files is extracted as page
  title when serving them
- lib/godoc.html is top-level template for all pages served
- experimented a bit with package documentation layout
  (feedback welcome)
- various related cleanups

TODO:
- The / page (doc/root.html) content repeats links that are
  in the navigation bar. It needs to be cleaned up.

R=rsc
DELTA=826  (86 added, 692 deleted, 48 changed)
OCL=35230
CL=35245
2009-10-01 14:08:00 -07:00
Rob Pike
69d13b2332 make the sidebars consistent
add Effective Go to the set of links

DELTA=166  (62 added, 57 deleted, 47 changed)
OCL=35085
CL=35089
2009-09-29 11:57:28 -07:00
Rob Pike
2e5a136e45 add a data section and start populating it with info about allocation, arrays
R=rsc
DELTA=331  (266 added, 61 deleted, 4 changed)
OCL=35024
CL=35030
2009-09-27 17:59:36 -07:00
Rob Pike
a5d6f8342c functions
R=rsc
DELTA=125  (103 added, 22 deleted, 0 changed)
OCL=34586
CL=34598
2009-09-14 10:40:44 -07:00
Rob Pike
c77c3b0196 string range
R=rsc
DELTA=22  (19 added, 0 deleted, 3 changed)
OCL=34463
CL=34463
2009-09-08 17:11:57 -07:00
Rob Pike
8aec612a80 for loops
comment out incomplete stuff

R=rsc
DELTA=61  (58 added, 0 deleted, 3 changed)
OCL=34278
CL=34281
2009-09-02 16:41:41 -07:00
Rob Pike
c409976b85 semicolons, ifs, switches
R=rsc
DELTA=196  (118 added, 24 deleted, 54 changed)
OCL=33716
CL=33727
2009-08-23 14:00:28 -07:00
Rob Pike
f0ccd40736 names
R=rsc
DELTA=96  (25 added, 5 deleted, 66 changed)
OCL=33607
CL=33612
2009-08-20 15:39:41 -07:00
Rob Pike
11e4db7c12 section about comments
R=rsc
DELTA=125  (13 added, 62 deleted, 50 changed)
OCL=33545
CL=33550
2009-08-19 16:39:25 -07:00
Rob Pike
22140a17a0 start of a rewrite with a different tone
R=rsc
DELTA=131  (61 added, 6 deleted, 64 changed)
OCL=33488
CL=33532
2009-08-19 13:24:24 -07:00
Rob Pike
401c0b3b46 get this out of the way
OCL=33178
CL=33180
2009-08-13 11:29:05 -07:00
Rob Pike
fe287e79c1 clean up a TODO
R=rsc
DELTA=45  (28 added, 4 deleted, 13 changed)
OCL=32673
CL=32675
2009-08-03 14:07:19 -07:00
Rob Pike
d951ce4e45 more info about comments
R=rsc
DELTA=100  (82 added, 4 deleted, 14 changed)
OCL=32609
CL=32615
2009-07-31 17:54:00 -07:00
Rob Pike
d1a3b98a8d cleanup pass before big edits
R=rsc
DELTA=73  (27 added, 25 deleted, 21 changed)
OCL=32587
CL=32587
2009-07-31 11:41:30 -07:00
Rob Pike
eaf6a344b7 a few edits and simplifications.
R=rsc
DELTA=248  (40 added, 108 deleted, 100 changed)
OCL=31211
CL=31211
2009-07-06 15:15:56 -07:00
David Symonds
25706fec19 Fix a doc typo.
R=rsc
APPROVED=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=30967
CL=30990
2009-07-01 15:07:20 -07:00
Russ Cox
94439982b6 Effective Go; draft
TBR=r
OCL=30741
CL=30741
2009-06-25 09:38:35 -07:00