1
0
mirror of https://github.com/golang/go synced 2024-09-25 07:20:12 -06:00
Commit Graph

1872 Commits

Author SHA1 Message Date
Rémy Oudompheng
d26d5e6403 effective_go.html: make snippets look formatted.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/11991043
2013-07-29 00:57:19 +02:00
Robert Griesemer
f331012427 spec: update prose in Constants section
Fixes #5952.

R=r, rsc
CC=golang-dev
https://golang.org/cl/11812043
2013-07-25 09:35:55 -07:00
Andrew Bonventre
f652bc4acf doc/go1.2.txt: document new functions/types added to image/gif and image/draw.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11492045
2013-07-24 12:41:52 +10:00
Rob Pike
ac94c06d1e doc/go1.2.txt: document new function unicode.In
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/11745044
2013-07-24 10:54:33 +10:00
Rob Pike
abe384f68a all: be more idiomatic when documenting boolean return values.
Phrases like "returns whether or not the image is opaque" could be
describing what the function does (it always returns, regardless of
the opacity) or what it returns (a boolean indicating the opacity).
Even when the "or not" is missing, the phrasing is bizarre.

Go with "reports whether", which is still clunky but at least makes
it clear we're talking about the return value.

These were edited by hand. A few were cleaned up in other ways.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/11699043
2013-07-23 11:59:49 +10:00
Andrew Gerrand
01cc462bfc doc: fix wiki content error
Fixes #5898.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11556043
2013-07-22 12:22:14 +10:00
Dave Cheney
deee03f17e doc/effective_go: stamp out stray GOROOT reference
Replaced with something more appropriate.

R=adg, r, minux.ma
CC=golang-dev
https://golang.org/cl/11421043
2013-07-17 18:48:55 +10:00
Russ Cox
64054a40ad encoding/json: coerce invalid UTF-8 to valid UTF-8 during Marshal
In practice, rejecting an entire structure due to a single invalid byte
in a string is just too picky, and too hard to track down.
Be consistent with the bulk of the standard library by converting
invalid UTF-8 into UTF-8 with replacement runes.

R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/11211045
2013-07-12 17:37:10 -04:00
Robert Griesemer
63f54ae3c2 spec: move decl in example closer to use
Fixes #5862.

R=r
CC=golang-dev
https://golang.org/cl/11168043
2013-07-11 14:41:46 -07:00
Shenghou Ma
72faa4bc51 syscall: implement Sendfile for Darwin.
Update #5847
Summary: syscall: implement Sendfile for OpenBSD and NetBSD

R=golang-dev, rsc, dave
CC=golang-dev
https://golang.org/cl/10980043
2013-07-12 04:34:54 +08:00
Robert Griesemer
8268eadb9e spec: define notion of named type
The notion of a named type is crucial for the definition
of type identity, assignability, definitions of methods.
Explicitly introduce the notion with an extra sentence.

Fixes #5682.

R=r, rsc, iant
CC=golang-dev
https://golang.org/cl/11055043
2013-07-09 21:12:53 -07:00
Andrew Gerrand
1856286fc2 doc: update playground.js
R=dsymonds
CC=golang-dev
https://golang.org/cl/10933044
2013-07-04 14:24:21 +10:00
Rob Pike
f3aa009a12 doc/go1.2.txt: stable sort
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/10761048
2013-07-03 11:46:09 +10:00
Andrew Gerrand
493538adbf cmd/godoc: set up playground for examples that are already visible
This fixes an issue where linking directly to an example makes it not
runnable and visible only in a tiny window. To see the bug in action,
visit this link: http://golang.org/pkg/strings/#example_Map

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10679050
2013-07-02 08:44:25 +10:00
Rick Arnold
49b3301f4c flag: add Getter interface; implement for all Value types
Fixes #5383.

R=golang-dev, 0xjnml, r, rsc
CC=golang-dev
https://golang.org/cl/10472043
2013-06-27 15:30:45 -07:00
Rob Pike
4f2278d4db doc/go1.2.txt: cmd/go and coverage; simple hash Sum functions
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/10631043
2013-06-27 09:20:02 -07:00
Robert Griesemer
de47f68c99 spec: fix spec on conversions to match implementations
The existing compilers convert empty strings to empty
but non-nil byte and rune slices. The spec required
a nil byte and rune slice in those cases. That seems
an odd additional requirement. Adjust the spec to
match the reality.

Also, removed over-specification for conversions of
nil []byte and []rune: such nil slices already act
like empty slices and thus don't need extra language.
Added extra examples instead.

Fixes #5704.

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/10440045
2013-06-21 16:11:13 -07:00
Ian Lance Taylor
ffde4970d0 doc: update gccgo docs
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10401046
2013-06-20 14:49:15 -07:00
Andrew Gerrand
7468b1d36a doc: style tweaks in preparation for Google Feedback link
Fixes #5589.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/10272051
2013-06-18 15:26:15 +10:00
Andrew Gerrand
55511d2b34 doc: add go1.1.1 to the release notes
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10236045
2013-06-13 12:43:26 +10:00
Shenghou Ma
06f55f5009 net: introduce netgo build tag to build a pure Go net package.
Fixes #4078.

R=golang-dev, bradfitz, rsc, iant
CC=golang-dev
https://golang.org/cl/7100050
2013-06-11 02:55:16 +08:00
Shenghou Ma
bdac989ef7 doc/go_spec: more examples for unspecified cases of the evaluation order
R=golang-dev, bradfitz, gri, iant, rsc
CC=golang-dev
https://golang.org/cl/7235044
2013-06-11 02:52:07 +08:00
Shenghou Ma
177191237e doc/install-source.html: recent ARM and 386 updates
R=golang-dev, dave, adg, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/6845083
2013-06-09 23:15:39 +08:00
Patrick Higgins
6bf6cae28e doc/contribute: add "Understanding the extension" section
Fixes #4996

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/7547043
2013-06-05 21:09:43 -07:00
Adam Langley
2112fed743 crypto/tls: support TLS 1.1.
The significant change between TLS 1.0 and 1.1 is the addition of an explicit IV in the case of CBC encrypted records. Support for TLS 1.1 is needed in order to support TLS 1.2.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7880043
2013-06-04 20:02:22 -04:00
Andrew Gerrand
850d1026ad doc: add Game of Life to playground toys
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/9961043
2013-06-04 12:59:28 +10:00
Shenghou Ma
022818c142 doc/articles: use C90 standard functions in the cgo article.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9953043
2013-06-04 01:40:53 +08:00
Andrew Gerrand
ae43ea432d doc: add Go 1.1 to release.html
Fixes #5468.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9853051
2013-06-03 11:52:36 +10:00
Dave Cheney
ec1769ba7b doc: update linux tarball version for Go 1.1
R=adg
CC=golang-dev
https://golang.org/cl/9819044
2013-06-03 11:47:42 +10:00
Shenghou Ma
1a145cd52d doc/go1.2.txt: update for CL 8248043.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9949044
2013-06-03 03:09:47 +08:00
Oling Cat
5b7d422a05 doc/go1.1.html: remove extra space; close some tags.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9941043
2013-06-01 10:28:04 -04:00
Robert Griesemer
ab5c762a46 spec: better wording re: receiving from closed channels
As suggested by ej@evanjones.ca.

Fixes #5604.

R=r
CC=golang-dev
https://golang.org/cl/9899043
2013-05-31 11:21:37 -07:00
Rob Pike
85fc2f70ac doc/go1.2.txt: AllocsPerRun now quantized
R=golang-dev, khr, rsc
CC=golang-dev
https://golang.org/cl/9728045
2013-05-30 12:41:20 -04:00
Shenghou Ma
5d081792b6 cmd/5a, cmd/dist, runtime: support m/g in the assembler, drop support for R9/R10
to avoid unintentionally clobber R9/R10.
Thanks Lucio for the suggestion.

PS: yes, this could be considered a big change (but not an API change), but
as it turns out even temporarily changes R9/R10 in user code is unsafe and
leads to very hard to diagnose problems later, better to disable using R9/R10
when the user first uses it.
See CL 6300043 and CL 6305100 for two problems caused by misusing R9/R10.

R=golang-dev, khr, rsc
CC=golang-dev
https://golang.org/cl/9840043
2013-05-30 03:03:52 +08:00
Katrina Owen
605da0e2a2 doc: Fix typo in approximation of square root
See https://en.wikipedia.org/wiki/Newton%27s_method#Square_root_of_a_number

R=golang-dev, minux.ma, adg
CC=golang-dev
https://golang.org/cl/9145044
2013-05-29 13:49:51 +10:00
Brian G. Merrell
20c524c5e2 effective_go.html: Fix two links
This fixes two intra-page "type assertion" links that were broken in
different ways.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9797043
2013-05-27 11:00:12 +10:00
Rob Pike
7472ce0e58 fmt.Printf: introduce notation for random access to arguments.
This text is added to doc.go:

        Explicit argument indexes:

        In Printf, Sprintf, and Fprintf, the default behavior is for each
        formatting verb to format successive arguments passed in the call.
        However, the notation [n] immediately before the verb indicates that the
        nth one-indexed argument is to be formatted instead. The same notation
        before a '*' for a width or precision selects the argument index holding
        the value. After processing a bracketed expression [n], arguments n+1,
        n+2, etc. will be processed unless otherwise directed.

        For example,
                fmt.Sprintf("%[2]d %[1]d\n", 11, 22)
        will yield "22, 11", while
                fmt.Sprintf("%[3]*[2].*[1]f", 12.0, 2, 6),
        equivalent to
                fmt.Sprintf("%6.2f", 12.0),
        will yield " 12.00". Because an explicit index affects subsequent verbs,
        this notation can be used to print the same values multiple times
        by resetting the index for the first argument to be repeated:
                fmt.Sprintf("%d %d %#[1]x %#x", 16, 17)
        will yield "16 17 0x10 0x11".

The notation chosen differs from that in C, but I believe it's easier to read
and to remember (we're indexing the arguments), and compatibility with
C's printf was never a strong goal anyway.

While we're here, change the word "field" to "arg" or "argument" in the
code; it was being misused and was confusing.

R=rsc, bradfitz, rogpeppe, minux.ma, peter.armitage
CC=golang-dev
https://golang.org/cl/9680043
2013-05-24 15:49:26 -07:00
Russ Cox
30fde1b279 doc: start go 1.2 notes
This is a file of hints, not a file of polished text.
Let's not try to do polished text until we start the
release process.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9750043
2013-05-24 16:34:50 -04:00
Ian Lance Taylor
452f3bc759 doc: GCC 4.8.1 is not updated to Go 1.1
I will try again for 4.8.2.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9663045
2013-05-22 13:05:31 -07:00
David Symonds
c912150761 doc/go_faq: fix example.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9564044
2013-05-22 12:28:58 +10:00
Robert Griesemer
6a3859f433 spec: removed old or invalid TODOs
Several old TODOs are either resolved now (e.g. when is a return
needed), or are from a time the language wasn't frozen (^ for uints
only). Consolidated the others.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9599044
2013-05-20 14:01:07 -07:00
Robert Griesemer
bb3a32ef6e spec: fix language about "range" clause
Fixes #5434.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9595044
2013-05-20 13:27:53 -07:00
Shenghou Ma
df29cdd33d doc/go_spec: fix typos
Fixes #5456.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9400044
2013-05-15 03:50:27 +08:00
Nigel Tao
0ae5036b26 doc: add a "New packages" section to the 1.1 release notes.
R=adg, r
CC=golang-dev
https://golang.org/cl/9344044
2013-05-12 21:58:27 -07:00
Robert Griesemer
2d846f6521 spec: fix incorrect example
Fixes #5430.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9305043
2013-05-08 10:42:08 -07:00
Andrew Gerrand
f0c3d26473 doc: pull front page featured articles using new blog JSON feed
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9288045
2013-05-08 09:23:50 -07:00
Rob Pike
2f326da27e effective_go.html: be more accepting in the guidelines for interface names
Fixes #5421.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/9274043
2013-05-07 11:41:36 -07:00
Andrew Gerrand
61dbc3401a doc: add FAQ entry about language changes
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/9244043
2013-05-06 15:02:56 -07:00
Shenghou Ma
6de184b385 syscall: fix prototype of Fchflags (API change)
API change, but the old API is obviously wrong.

R=golang-dev, iant, r, rsc
CC=golang-dev
https://golang.org/cl/9157044
2013-05-07 05:20:00 +08:00
Andrew Gerrand
48c4a87a94 doc: fix formatting in effective go code snippet
Fixes #5403.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9100046
2013-05-03 15:24:05 -04:00
Russ Cox
a941491b4e doc: only U+FEFF is a byte-order mark; U+FFFE is not
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9103046
2013-05-02 15:01:31 -04:00
Andrew Gerrand
3bd076991b doc: link to Go 1.1 release notes
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9047045
2013-05-01 10:00:05 -04:00
Andrew Gerrand
e2b2e0d8d1 doc/go1.1: remove discussion of "go run" change
Update #5164

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/9049043
2013-04-30 09:47:23 -04:00
Shenghou Ma
7bec1a6033 all: fix typos
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8896045
2013-04-24 04:46:14 +08:00
Oling Cat
e680710d0e doc/code.html: remove doubled word; modify the tab to space.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8919043
2013-04-23 13:13:51 -07:00
Jeremy Jackins
2dd0c03427 doc: fix typo in race_detector.html
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8625044
2013-04-23 13:11:58 -07:00
Shenghou Ma
ed19ab47c3 doc/effective_go.html: fix syntax error in code example
Fixes #5333.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/8698046
2013-04-24 03:51:31 +08:00
Andrew Gerrand
994c486aa9 doc: fix typo in Effective Go
Fixes #5329.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8897044
2013-04-22 16:57:23 +02:00
Jonathan Rudenberg
b0cd458605 doc: add missing <code> to go1.1.html
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/8880043
2013-04-21 13:10:19 +02:00
Brad Fitzpatrick
10cdb92000 doc: fix another broken link
Fixes #5316

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/8871043
2013-04-19 12:00:40 -07:00
Rob Pike
1f4055a0ec doc/go1.1.html: document io.ErrNoProgress
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8833050
2013-04-18 17:37:09 -07:00
Brad Fitzpatrick
db6ddff842 doc: fix another broken link
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8763045
2013-04-18 14:48:54 -07:00
Brad Fitzpatrick
12566a60d7 doc: misc tweaks, new links, fix broken links
I read docs and wrote a crawler + link checker on the plane,
which also checks for #fragments. I'll send that out later
when it's less gross.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8729050
2013-04-18 12:43:23 -07:00
Brad Fitzpatrick
32f2fd15df doc/go1.1.html, mime/multipart: document quoted-printable decoding
Fixes #5293

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8840043
2013-04-17 13:25:28 -07:00
Rob Pike
a9c695204d doc: more doubled words
I wrote a tool.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8695047
2013-04-16 14:20:06 -07:00
Rob Pike
f29013d19b doc/effective_go: another doubled word
It's clear that that should never happen.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8798045
2013-04-16 13:59:10 -07:00
Shenghou Ma
86cd1d9e15 doc/effective_go.html: fix typo
Fixes #5296.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8682044
2013-04-17 04:41:28 +08:00
Shenghou Ma
80de7ab190 doc/reference.html: update list of sub-repositories.
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/8766043
2013-04-16 04:31:25 +08:00
Stefan Nilsson
0009210b2e doc: fix typo
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/8729045
2013-04-14 09:22:57 +10:00
Rob Pike
548c65a568 spec: add another sentence about BOMs
Although one may argue that they should be legal, gc (at least)
disallows byte order marks that are not the first code point
in the file. Added a sentence to the "Implementation restriction"
clause in the "Source code representation" section to document
this better.

Lifting this restriction (again - the rule has changed at least
twice already) would not break any existing programs, should
we later decide yet again to fiddle the rules about these little
fly specks.

R=golang-dev, dsymonds, gri
CC=golang-dev
https://golang.org/cl/8649043
2013-04-11 11:33:25 -07:00
Jonathan Rudenberg
f9af491307 doc: fix typos in go1.1.html
R=golang-dev, adg, adg
CC=golang-dev
https://golang.org/cl/8488047
2013-04-08 12:04:50 +10:00
Andrew Gerrand
78c4d50d25 doc: document go1.1 build tag
Fixes #5235.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8426048
2013-04-08 11:41:01 +10:00
Kamil Kisiel
13d6f8f7f3 godoc: enable visibility of element linked from URL hash
Expands the example when visiting a URL such as
http://golang.org/pkg/net/http/#example_Hijacker

Fixes #5212.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/8378043
2013-04-05 08:04:02 +11:00
Andriy Lytvynov
a854535556 doc/code.html: fix typos
Fixed example program's output to match program's code.
Fixes #5204.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/8365043
2013-04-04 11:11:54 -07:00
Duncan Holm
52700d24bc doc: use the already defined GOPATH in PATH
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/8248044
2013-04-04 16:36:10 +11:00
Dave Cheney
19cc9f91fa doc/go1.1.html: mention cgo and cross compilation
R=r, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/8304043
2013-04-04 16:13:29 +11:00
Andrew Gerrand
485c066222 doc: mention availability of race detector in go1.1 doc
R=r
CC=golang-dev
https://golang.org/cl/8301044
2013-04-04 16:10:30 +11:00
Jonathan Rudenberg
2a99f2fb2a cmd/go: run main package when no files are listed
Fixes 5164.

R=golang-dev, iant, adg
CC=golang-dev
https://golang.org/cl/8119049
2013-04-04 12:04:35 +11:00
Dmitriy Vyukov
72d99aec88 doc: fix typos in go1.1
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8342044
2013-04-03 17:03:42 -07:00
Alexei Sholik
5977e34741 doc: fix typos and trailing spaces
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/8285044
2013-04-03 16:44:03 -07:00
Andrew Gerrand
e798cd857c doc: mention godoc.org in "How to Write Go Code"
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8344043
2013-04-04 08:56:11 +11:00
Andrew Gerrand
ee923e3f90 doc: simplify How to write Go code article
This version just tells you what to do, rather
than trying to teach you how it all works.
Should be much better for newcomers.

R=dave, gary.burd, alcosholik, r
CC=golang-dev
https://golang.org/cl/8247044
2013-04-04 08:19:24 +11:00
Rob Pike
c4e82bb923 doc: link the race detector document into the release notes
Also:
- put GORACE into the go env command
- do minor housekeeping on the race detector article

Fixes #4995.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/8319044
2013-04-03 13:56:24 -07:00
Rob Pike
a9e1c8fb41 doc/go1.1.html: document the state of gccgo
Fixes #5053.

R=adg, iant
CC=golang-dev
https://golang.org/cl/8337043
2013-04-03 13:29:06 -07:00
Rob Pike
e0f338cca5 doc/go1.1.html: document os/signal.Stop
Also fix the sort order of the laundry list.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8325044
2013-04-03 10:59:36 -07:00
Rob Pike
91cb9995c3 doc/go1.1.html: state that the heap is bigger on 64-bit machines
Be deliberately vague, since the precise details should not be depended upon.
Fixes #5155.

R=golang-dev, gri, adg
CC=golang-dev
https://golang.org/cl/8283044
2013-04-03 10:40:33 -07:00
Robert Griesemer
b34f055138 spec: Go has no 'reference types'
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8288044
2013-04-02 23:17:37 -07:00
Dave Cheney
839c4f0159 doc/go1.1.html: additional tweaks
R=r, adg, minux.ma
CC=golang-dev
https://golang.org/cl/8250043
2013-04-03 16:49:17 +11:00
Andrew Gerrand
062a86b07d doc: add prominent download button to getting started page
Also remove the introduction, which says what the rest of the
page says anyway.

Fixes #5182.

R=golang-dev, kamil.kisiel, r
CC=golang-dev
https://golang.org/cl/8281044
2013-04-03 15:59:17 +11:00
Brad Fitzpatrick
751a24e86e net: delete DialOpt and DialOption; add struct Dialer
Per discussions on golang-nuts and golang-dev:
"Some concerns with DialOpt"
https://groups.google.com/d/msg/golang-nuts/Hfh9aqhXyUw/W3uYi8lOdKcJ
https://groups.google.com/d/msg/golang-dev/37omSQeWv4Y/KASGIfPpXh0J

R=golang-dev, google, r
CC=golang-dev
https://golang.org/cl/8274043
2013-04-02 13:24:16 -07:00
Brad Fitzpatrick
4432be3b28 compress/gzip: add Writer.Flush to call flate.Writer's Flush
From a discussion on golang-nuts.

R=golang-dev, dsymonds, nigeltao, coocood, adg
CC=golang-dev
https://golang.org/cl/8251043
2013-04-02 09:07:43 -07:00
Dave Cheney
54faecac0b doc/go1.1.html: add a note about additional platforms
Mention support for NetBSD, OpenBSD, and cgo for linux/arm.

R=golang-dev, dvyukov, r, minux.ma, adg, bradfitz, adg
CC=golang-dev
https://golang.org/cl/8152043
2013-04-02 15:08:28 +11:00
Rob Pike
b91ae5c27c doc/codewalk/markov: fix slice error in description
Fixes #5176.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8118046
2013-04-01 15:52:15 -07:00
Shenghou Ma
6e054190f7 doc/go1.1: mention (*testing.B).ReportAllocs()
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8198043
2013-03-31 02:17:25 +08:00
Elias Naur
c1786a9e3b doc: fix typo in effective_go.html
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7548045
2013-03-29 10:28:37 -07:00
Robert Griesemer
04341b246e cmd/godoc: cleanups
- removed gratuitous empty lines that creeped into command line output
- changed comment color to a dark green so that links don't visually melt into them
- removed some TODOs
- updated doc.go

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8108044
2013-03-28 13:05:30 -07:00
Rob Pike
48ecfc979f faq: update with some links and 1.1-specific details
R=golang-dev, remyoudompheng, iant
CC=golang-dev
https://golang.org/cl/8038048
2013-03-27 15:26:57 -07:00
Jonathan Rudenberg
0657e7df9f doc: fix go1.1.html typos
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7635049
2013-03-27 11:09:14 -07:00
Dave Cheney
24c2c88b90 doc: consistent path names in example
Always use /home/you for $HOME in examples.

Trivial enough that someone else can integrate this change if they are editing go1.1.html

R=r
CC=golang-dev
https://golang.org/cl/8025043
2013-03-27 09:22:23 +11:00
Rob Pike
a101bfc620 doc/go1.1.html: net/mail, net/smtp
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7835049
2013-03-26 11:47:27 -07:00
Rob Pike
237b8b8b66 doc/go1.1.html: describe Zone and other net changes
Mild adaptation of rsc's 8021043, which I was unable to clpatch.
(rsc is offline)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7741049
2013-03-26 10:54:55 -07:00
Andrew Gerrand
a52855535a doc: fix typo in go 1.1 doc
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7725049
2013-03-26 09:37:17 -07:00
David Symonds
1e0e65ea59 doc/articles: update reference to obsolete "package documentation".
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7475048
2013-03-26 13:01:24 +11:00
Rob Pike
4529c047b8 doc/go1.1.html: introduction
R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/7696045
2013-03-25 17:41:12 -07:00
Brad Fitzpatrick
35c85321cc doc: add summary of net/http additions to Go 1.1
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7812050
2013-03-25 15:17:44 -07:00
Brad Fitzpatrick
fc4c5b14ef doc: add DialOpt and friends to go1.1.html
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7725048
2013-03-25 10:31:19 -07:00
Rob Pike
4c48e4ecb5 doc/go1.1.html: performance
An overview is all that's required.

R=golang-dev, remyoudompheng, bradfitz, adg
CC=golang-dev
https://golang.org/cl/7577050
2013-03-23 08:29:59 -07:00
Robert Griesemer
259e8cec7a doc/go1.1.html: fix broken links
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7834049
2013-03-22 16:41:27 -07:00
Rob Pike
bfeb79bae5 doc/go1.1.html: blockprofile, method values, ListenUnixgram, etc.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/7496051
2013-03-22 15:45:16 -07:00
Robert Griesemer
462a17e0f3 spec: remove most §links for the now more common in-text links
Also:
- more consistenly use "xxx" statement rather than <code>xxx</code> statement
- fix/remove unnecessary links

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7821050
2013-03-22 15:36:04 -07:00
Rob Pike
7191ef7199 doc/go1.1.html: return requirements
R=golang-dev, rsc, jeremyjackins, gri
CC=golang-dev
https://golang.org/cl/7838045
2013-03-22 14:51:22 -07:00
Rob Pike
d02089101c spec: add example showing missing return statement
Will help people find the rules by searching the spec by
having a comment saying "missing return";
"terminating statement" does not evoke the rule to the
uninitiated.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7838044
2013-03-22 10:03:55 -07:00
Rob Pike
d88133137b go1.1.html: bufio.Scanner and reflect; more about surrogates
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7958043
2013-03-21 22:37:13 -07:00
Russ Cox
aafc444b74 debug/elf: restore Go 1.0 semantics for (*File).Symbols
Also adjust the implementation of applyRelocationsAMD64
so that the test added in CL 6848044 still passes.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7686049
2013-03-21 17:01:39 -04:00
Rob Pike
178d8d4f7a doc/go1.1.html: more TODOs done
Only the net stuff remains as significant work in the "minor changes" section.

R=golang-dev, dave, elias.naur, rsc
CC=golang-dev
https://golang.org/cl/7933044
2013-03-21 13:51:49 -07:00
Rob Pike
b636f192e2 spec: fix description of initialization
The analysis does not depend on the values of the items.
Fixes #4648.

R=golang-dev, gri, rsc
CC=golang-dev
https://golang.org/cl/7593050
2013-03-20 15:05:28 -07:00
Russ Cox
6e15683cae spec: define method values
Fixes #2280.

R=golang-dev, r, bradfitz, iant, andybalholm, gri
CC=golang-dev
https://golang.org/cl/7816045
2013-03-20 16:54:07 -04:00
Rob Pike
ee5a794fbb doc/go1.1.html: add links to the text, write some new sections
R=golang-dev, rsc, dave
CC=golang-dev
https://golang.org/cl/7914043
2013-03-19 16:40:19 -07:00
Rob Pike
b89a2bcf01 doc/go1.1.html: document the surrogate and BOM changes
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7853048
2013-03-18 22:50:32 -07:00
Rob Pike
f005eddb3a doc/go1.1.html: document some of the library changes.
Still much to do, but this is a start.

R=golang-dev, adg, bradfitz, remyoudompheng
CC=golang-dev
https://golang.org/cl/7729046
2013-03-18 15:27:05 -07:00
Robert Griesemer
58e21ddaf9 spec: remove special int rule for shifts
The rule is not concistently followed by gc.
It appears that gccgo is ignoring it. go/types
does not implement this rule. However, both
gccgo and now go/types can compile/type-check
the entire std library (and thus all the shift
expressions occuring in it) w/o errors. For
more details see the discussion in issue 4883.

Fixes #4880.
Fixes #4881.
Fixes #4883.

R=rsc, r, iant, ken, ken, mtj, rogpeppe
CC=golang-dev
https://golang.org/cl/7707043
2013-03-15 13:55:50 -07:00
Herbert Georg Fischer
99021b767f doc: explain why cmd/go uses https for repositories and how to work around it
Fixes #3418.

R=golang-dev, r
CC=adg, golang-dev
https://golang.org/cl/7712045
2013-03-15 13:43:10 -07:00
Rob Pike
09cd13c51d doc/go_faq.html: add entry about pointer to interface
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7546050
2013-03-15 11:38:50 -07:00
Mike Rosset
b4afe88973 doc: clarify that gccgo is a GCC front-end
R=golang-dev, r, iant, iant
CC=golang-dev
https://golang.org/cl/6454072
2013-03-12 17:12:56 -07:00
Rob Pike
c34050fd53 spec: rewrite the description of panic and recover.
The old description was misleading and inaccurate.

Fixes #4774.

R=iant, rsc, gri
CC=golang-dev
https://golang.org/cl/7761044
2013-03-12 14:28:16 -07:00
Rob Pike
9dfcfb9385 effective_go.html: fix semaphore example
It didn't work properly according to the Go memory model.
Fixes #5023.

R=golang-dev, dvyukov, adg
CC=golang-dev
https://golang.org/cl/7698045
2013-03-12 10:53:01 -07:00
Robert Griesemer
b66df0e9ba spec: typed indices must be of integer type
The same rules apply for make arguments.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/7656043
2013-03-11 09:20:52 -07:00
Robert Griesemer
c729ed631f spec: result type of a comparison is always untyped bool
For details see the cited issue.

Fixes #4793.

R=rsc, r, iant, ken
CC=golang-dev
https://golang.org/cl/7524044
2013-03-11 09:16:29 -07:00
Rick Arnold
cea78cb58e doc/contribute: add instructions to fix codereview on windows
Tell Windows users how to update Mercurial's library.zip to add some missing dependencies.

Fixes #4745.

R=golang-dev, patrick.allen.higgins, minux.ma, adg
CC=golang-dev
https://golang.org/cl/7558043
2013-03-11 12:14:42 +11:00
Rob Pike
33e8ca4d67 effective_go.html: add a section on type assertions
The information was missing, oddly enough.

R=golang-dev, rsc, iant
CC=golang-dev
https://golang.org/cl/7636044
2013-03-08 13:53:17 -08:00
Rob Pike
9e329a0d16 effective_go.html: move and rework the blank identifier section
Also rename the relevant examples and make sure the working one compiles.

R=golang-dev, bradfitz, adg, iant, rsc
CC=golang-dev
https://golang.org/cl/7597043
2013-03-08 10:41:20 -08:00
Robert Griesemer
51338095eb spec: clarify unsafe.Offsetof
Fixes #4905.

R=rsc, r, iant, ken
CC=golang-dev
https://golang.org/cl/7583043
2013-03-07 20:11:37 -08:00
Rob Pike
45a3b3714f doc/effective_go.html: unify and expand the discussion of Sprintf and String
It's a common mistake to build a recursive String method; explain it well and
show how to avoid it.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/7486049
2013-03-06 15:47:49 -08:00
Rob Pike
5f07125cb9 effective_go.html: round 3 of minor edits.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7489044
2013-03-06 10:08:48 -08:00
Rob Pike
b3915112b9 doc/effective_go.html: update slices and maps.
Drop the phrase "reference types", which has caused confusion.
Add a section about 2D arrays, a common newbie question.

R=golang-dev, cespare, adg, rsc
CC=golang-dev
https://golang.org/cl/7423051
2013-03-05 14:13:53 -08:00
Robert Griesemer
9905cec0dc spec: terminating statements for functions
The only functional change is the new section
on terminating statements.

There is a minor syntax rewrite (not change)
of function declarations to make it easier to
refer to the notion of a function from all places
where it is used (function decls, method decls,
and function literals).

Includes some minor fixes/additions of missing links.

Based closely on Russ' proposal.

Fixes #65.

R=rsc, r, iant, ken, bradfitz
CC=golang-dev
https://golang.org/cl/7415050
2013-03-04 13:55:35 -08:00
Robert Griesemer
4be38dde84 spec: cyclic imports are illegal
Fixes #4976.

R=r
CC=golang-dev
https://golang.org/cl/7421050
2013-03-04 12:59:40 -08:00
Rob Pike
bfbac2dc1c doc/go1.1.html: fix typo in URL
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7423050
2013-03-03 09:12:36 -08:00
Rob Pike
5aacf43651 doc/go1.1.html: document the moving of exp/... and old/....
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7445050
2013-03-02 11:55:25 -08:00
Robert Griesemer
67a6b4f0ef spec: fallthrough may not appear in last clause of a switch
Replacement for CL 7370053 which attempted to make fallthrough's
syntactically a part of switch statements. Because they may be
labeled, fixing that CL completely would require too much spec
surgery.

Fixes #4923.

R=r, iant, rsc, ken
CC=golang-dev
https://golang.org/cl/7416048
2013-03-01 16:45:14 -08:00
Rob Pike
6bfec725cf doc/effective_go.html: minor updates, part 1
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7454044
2013-02-28 16:57:55 -08:00
Andrew Gerrand
17d12d6cb6 doc: fix root.html styles
R=r
CC=golang-dev
https://golang.org/cl/7442045
2013-03-01 11:22:13 +11:00
Rob Pike
2145cd51e3 doc/articles/image_package.html: fix x/y mistake
Fixes #4942.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7444047
2013-02-28 15:52:58 -08:00
Rob Pike
7ae41e8010 doc: correct some minor HTML errors found by tidy
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7439046
2013-02-28 13:32:36 -08:00
Rob Pike
fbec8347cb doc/effective_go.html: use correct name in Interface Checks section
Fixes #4897.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7377061
2013-02-27 14:42:53 -08:00
Andrew Gerrand
93158bf243 doc: document that weekly.html is only a historical reference
Fixes #4810.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7401050
2013-02-26 09:23:34 +11:00
Andrew Gerrand
052d845c5c doc: fix wiki codelab description of template parsing
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7372048
2013-02-26 08:31:47 +11:00
Russ Cox
aed05446b4 doc: mention go fix in go1.1 release notes draft
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/7379045
2013-02-21 14:28:34 -05:00
Brad Fitzpatrick
92ab6fb4e1 doc: fix old broken link
The Camlistore code tree rearranged after the go tool came
out. (I didn't know this link was here until I saw it in
some logs.)

R=adg
CC=golang-dev
https://golang.org/cl/7374043
2013-02-19 22:40:54 -08:00
Shenghou Ma
d251fc39f2 doc/gccgo_contribute: mention gofrontend-dev@googlegroups.com mailing list
R=iant
CC=golang-dev
https://golang.org/cl/7323064
2013-02-19 19:20:44 +08:00
Russ Cox
61e02ee901 spec: clarify when range x does not evaluate x
Fixes #4644.

R=r, adonovan
CC=golang-dev
https://golang.org/cl/7307083
2013-02-15 14:39:28 -05:00
Oling Cat
aecbcd0914 doc/contribute: fix some tags, remove extra space.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7327048
2013-02-15 14:01:12 +11:00
David Symonds
4101469ccc doc: adjust indentation in Effective Go commentary example.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7225080
2013-02-13 16:43:55 +11:00
Russ Cox
71c941b6f6 spec: only require parens around ambiguous conversions
This is documenting the status quo. The previous cleanup
added this language as an implementation restriction, but
at least for now it is really part of the language proper.

Fixes #4605.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7305071
2013-02-11 07:48:14 -05:00
Russ Cox
7576179aa3 spec: document fp rounding during explicit constant conversion
The gc compilers already behave this way. It was an explicit
decision during the very long constant design discussions,
but it appears not to have made it into the spec.

Fixes #4398.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7313069
2013-02-11 07:47:41 -05:00
Russ Cox
0a22018d46 spec: reject top-level init names
Fixes #4586.

R=golang-dev, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/7307082
2013-02-11 07:46:39 -05:00
Dave Cheney
eda9590aae doc: update contribute.html
Fixes #4582.

* mentioned hg upload.
* added section on hg file.
* added small mention about being inside $GOROOT.
* added hg revert @NNNN
* reorganise the hg submit section for the common case of a non committer.
* made the Copyright section h2
* added note about leaving copyright years unchanged.

R=golang-dev, metanata4, shivakumar.gn, minux.ma, adg, shanemhansen
CC=golang-dev, metanata4
https://golang.org/cl/7278047
2013-02-10 19:40:33 -05:00
Dave Cheney
d8630694db doc: move os specific build instructions to wiki
Fixes #4010.

This proposal avoids cluttering the main install-source.html with OS specific instructions by linking to the wiki for details. See discussion in the comments.

R=adg, minux.ma
CC=golang-dev
https://golang.org/cl/7241068
2013-02-10 17:39:13 -05:00
Greg Ward
74e1577645 doc: link to wiki Projects page instead of old Project Dashboard.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7308079
2013-02-11 09:18:31 +11:00
Russ Cox
81eb930f7e spec: clarify that any unsafe.Pointer type is okay in conversion
The spec is not clear about whether this is allowed or not,
but both compilers allow it, because the reflect implementation
takes advantage of it. Document current behavior.

Fixes #4679.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7303064
2013-02-09 17:36:31 -05:00
Russ Cox
1b3083e68d spec: clarify that f(g()) requires that g return >= 1 value
Fixes #4573.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7322043
2013-02-09 14:46:55 -05:00
Shenghou Ma
fe51d09bbe doc/articles/error_handling: no more os.Error
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7304053
2013-02-06 18:32:54 +08:00
Russ Cox
d314e3a68e doc/codewalk: gofmt pig.go
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7221079
2013-01-31 13:42:26 -08:00
Russ Cox
779e9dfd4d doc/go1.1.html: document division by zero change from CL 6710045
I am still not convinced this is a change we should make, but at least
documenting it will keep us from forgetting it as we get closer to Go 1.1.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7226064
2013-01-30 09:23:36 -08:00
Andrew Gerrand
7a389b61d4 doc: add mention of the Go+ community
R=golang-dev, iant, kamil.kisiel, minux.ma
CC=golang-dev
https://golang.org/cl/7203049
2013-01-25 08:27:34 +11:00
Oling Cat
018e89fa69 doc/go_spec: remove extra space, align tags, and change a tab to a space.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7198048
2013-01-24 20:46:33 +11:00
Oling Cat
f1c397f0ea doc/articles/race_detector: fix some format.
R=golang-dev, bradfitz, minux.ma, adg
CC=golang-dev
https://golang.org/cl/7137049
2013-01-23 14:22:03 +11:00
Russ Cox
f8284b64ce doc/effective_go.html: add a section about the blank identifier
R=golang-dev, minux.ma, bradfitz, adg
CC=golang-dev
https://golang.org/cl/7134056
2013-01-22 14:00:10 -05:00
Shenghou Ma
a0b5b46ae4 doc/go_spec: cap doesn't apply to maps
Fixes #4682.

R=golang-dev, adg, dave
CC=golang-dev
https://golang.org/cl/7094062
2013-01-22 03:18:20 +08:00
Nigel Tao
c8c8ab08ed doc: fix effective_go: s/byte array/byte slice/.
R=rsc
CC=golang-dev, mdempsky
https://golang.org/cl/7062049
2013-01-19 13:36:59 +11:00
Robert Griesemer
d3679726b4 spec: clarify lhs syntax for range and select
Fixes #4653.

R=rsc, r, iant, ken, thakis
CC=golang-dev
https://golang.org/cl/7135058
2013-01-18 13:59:25 -08:00
Russ Cox
c64469f8e8 doc/contribute.html: mention hg mail during hg change discussion
People keep not reading all the way to the bottom of the doc
and not running hg mail.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7137057
2013-01-18 14:08:42 -05:00
Andrew Gerrand
c022943449 html/template: remove noescape support
This was never documented or properly implemented.

Fixes #3528.

R=mikesamuel, rsc
CC=golang-dev
https://golang.org/cl/7142048
2013-01-18 10:30:12 +11:00
Shenghou Ma
ced57153df doc/go_spec.html: clarification about insertion during map iteration
R=mdempsky, iant, r, gri, rsc, ken
CC=golang-dev
https://golang.org/cl/7100046
2013-01-17 23:11:25 +08:00
Oling Cat
f5958c6141 doc/articles/json_and_go: fix some format.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7131045
2013-01-17 15:08:20 +11:00
Andrew Gerrand
399a36a634 doc: fix various fragment links
R=dsymonds
CC=golang-dev
https://golang.org/cl/7094058
2013-01-15 19:25:16 +11:00
Matthew Dempsky
7d403871cb doc/contribute: Link to IssueTracker docs for more "special sentences"
Update #4582.

R=nigeltao, dave, adg
CC=golang-dev
https://golang.org/cl/7070065
2013-01-10 14:17:20 +11:00
Dave Cheney
593d8b0c14 cmd/go: remove $GOROOT as a go get target
Fixes #4186.

Back in the day, before the Go 1.0 release, $GOROOT was mandatory for building from source. Fast forward to now and $GOPATH is mandatory and $GOROOT is optional, and mainly used by those who use the binary distribution in uncommon places.

For example, most novices at least know about `sudo` as they would have used it to install the binary tarball into /usr/local. It is logical they would use the `sudo` hammer to `go get` other Go packages when faced with a permission error talking about the path they just had to use `sudo` on last time.

Even if they had read the documentation and set $GOPATH, go get will not work as expected as `sudo` masks most environment variables.

llucky(~) % ~/go/bin/go env | grep GOPATH
GOPATH="/home/dfc"
lucky(~) % sudo ~/go/bin/go env | grep GOPATH
GOPATH=""

This CL therefore proposes to remove support for using `go get` to download source into $GOROOT.

This CL also proposes an error when GOPATH=$GOROOT, as this is another place where new Go users can get stuck.

Further discussion: https://groups.google.com/d/topic/golang-nuts/VIg3fjHiHRI/discussion

R=rsc, adg, minux.ma
CC=golang-dev
https://golang.org/cl/6941058
2013-01-10 09:57:01 +11:00
Robert Griesemer
f1cc0f44e3 spec: clarify short variable declaration corner cases
Fixes #4612.

R=rsc, iant, ken, r
CC=golang-dev
https://golang.org/cl/7076043
2013-01-09 11:31:32 -08:00
Matthew Dempsky
a6e4aa3ef2 doc: Mention godoc's handling of example functions.
Fixes #4625.

R=iant, adg
CC=golang-dev
https://golang.org/cl/7064052
2013-01-09 07:31:25 -08:00
Oling Cat
bc776f6c58 doc/articles/go_command: remove an extra word.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7061051
2013-01-08 09:49:38 -08:00
Robert Griesemer
c863db4e87 spec: s/char_lit/rune_lit/
The spec talks explicitly about rune literals but the
respective production is still called char_lit for
historic reasons. Updated the two occurences.

Fixes #4602.

R=rsc, iant, r, ken
CC=golang-dev
https://golang.org/cl/7070048
2013-01-07 18:02:58 -08:00
Caleb Spare
41f32e0dff doc: two minor edits to contribute.html
- Missing parenthesis
- Fix bad phrasing

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7063048
2013-01-06 22:44:16 -05:00
Matthew Dempsky
80a87a99cc spec: Use "non-negative" instead of "positive"
Replacing division-by-power-of-2 with right-shift is valid for
zero too.

R=gri
CC=golang-dev
https://golang.org/cl/7027049
2013-01-06 16:56:06 -08:00
Robin Eklind
1e1aea6821 doc: Updated links for sub-repository documentation.
Use godoc.org instead of gopkgdoc.appspot.com.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7036051
2013-01-07 09:10:09 +11:00
Russ Cox
cbbc6a102d cmd/5l, cmd/6l, cmd/8l, cmd/cc, cmd/gc: new flag parsing
This CL adds a flag parser that matches the semantics of Go's
package flag. It also changes the linkers and compilers to use
the new flag parser.

Command lines that used to work, like
        8c -FVw
        6c -Dfoo
        5g -I/foo/bar
now need to be split into separate arguments:
        8c -F -V -w
        6c -D foo
        5g -I /foo/bar
The new spacing will work with both old and new tools.

The new parser also allows = for arguments, as in
        6c -D=foo
        5g -I=/foo/bar
but that syntax will not work with the old tools.

In addition to matching standard Go binary flag parsing,
the new flag parser generates more detailed usage messages
and opens the door to long flag names.

The recently added gc flag -= has been renamed -complete.

R=remyoudompheng, daniel.morsing, minux.ma, iant
CC=golang-dev
https://golang.org/cl/7035043
2013-01-06 15:24:47 -05:00
Russ Cox
4e2aa9bff0 cmd/ld: use native-endian symbol values in symbol table
The Plan 9 symbol table format defines big-endian symbol values
for portability, but we want to be able to generate an ELF object file
and let the host linker link it, as part of the solution to issue 4069.
The symbol table itself, since it is loaded into memory at run time,
must be filled in by the final host linker, using relocation directives
to set the symbol values. On a little-endian machine, the linker will
only fill in little-endian values during relocation, so we are forced
to use little-endian symbol values.

To preserve most of the original portability of the symbol table
format, we make the table itself say whether it uses big- or
little-endian values. If the table begins with the magic sequence
        fe ff ff ff 00 00
then the actual table begins after those six bytes and contains
little-endian symbol values. Otherwise, the table is in the original
format and contains big-endian symbol values. The magic sequence
looks like an "end of table" entry (the fifth byte is zero), so legacy
readers will see a little-endian table as an empty table.

All the gc architectures are little-endian today, so the practical
effect of this CL is to make all the generated tables little-endian,
but if a big-endian system comes along, ld will not generate
the magic sequence, and the various readers will fall back to the
original big-endian interpretation.

R=ken2
CC=golang-dev
https://golang.org/cl/7066043
2013-01-04 17:03:57 -05:00
Robert Griesemer
614b02d22a spec: clarify language about unary operator &
A composite literal may be parenthesized when
used as operand for the unary operator &.

R=rsc, iant, r, ken
CC=golang-dev
https://golang.org/cl/6996053
2013-01-02 18:11:49 -08:00
Dmitriy Vyukov
b2e9ca7f2e doc: add race detector manual
R=minux.ma, franciscossouza, rsc, adg, adg
CC=golang-dev
https://golang.org/cl/6948043
2013-01-02 16:38:47 +04:00
Andrew Gerrand
d5d046e306 doc: update standard copyright header
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7034044
2013-01-02 16:26:25 +11:00
Péter Surányi
be7c0f31c7 doc: fix id attributes in links to godoc
CL6449105 changed godoc id attributes to ensure uniqueness.
This CL updates links to godoc pages in documents that used
the old id attributes.

R=golang-dev, dsymonds
CC=golang-dev, speter.go1
https://golang.org/cl/7015051
2012-12-29 10:41:39 +11:00
Shenghou Ma
fcc5cf639e doc/articles/wiki/test.bash: suppress unnecessary output
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7000045
2012-12-24 03:48:17 +08:00
Russ Cox
04098d88fa cmd/gc: make forward declaration in pure Go package an error
An error during the compilation can be more precise
than an error at link time.

For 'func init', the error happens always: you can't forward
declare an init func because the name gets mangled.

For other funcs, the error happens only with the special
(and never used by hand) -= flag, which tells 6g the
package is pure go.

The go command now passes -= for pure Go packages.

Fixes #3705.

R=ken2
CC=golang-dev
https://golang.org/cl/6996054
2012-12-22 16:46:46 -05:00
Joel Sing
708db79011 cgo: enable cgo on openbsd
Enable cgo on OpenBSD.

The OpenBSD ld.so(1) does not currently support PT_TLS sections. Work
around this by fixing up the TCB that has been provided by librthread
and reallocating a TCB with additional space for TLS. Also provide a
wrapper for pthread_create, allowing zeroed TLS to be allocated for
threads created externally to Go.

Joint work with Shenghou Ma (minux).

Requires change 6846064.

Fixes #3205.

R=golang-dev, minux.ma, iant, rsc, iant
CC=golang-dev
https://golang.org/cl/6853059
2012-12-21 01:43:19 +11:00
Shenghou Ma
7777bac6e4 runtime: use clock_gettime to get ns resolution for time.now & runtime.nanotime
For Linux/{386,arm}, FreeBSD/{386,amd64,arm}, NetBSD/{386,amd64}, OpenBSD/{386,amd64}.
Note: our Darwin implementation already has ns resolution.

Linux/386 (Core i7-2600 @ 3.40GHz, kernel 3.5.2-gentoo)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          110          118   +7.27%

Linux/ARM (ARM Cortex-A8 @ 800MHz, kernel 2.6.32.28 android)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          625          542  -13.28%

Linux/ARM (ARM Cortex-A9 @ 1GHz, Pandaboard)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          992          909   -8.37%

FreeBSD 9-REL-p1/amd64 (Dell R610 Server with Xeon X5650 @ 2.67GHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          699          695   -0.57%

FreeBSD 9-REL-p1/amd64 (Atom D525 @ 1.80GHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow         1553         1658   +6.76%

OpenBSD/amd64 (Dell E6410 with i5 CPU M 540 @ 2.53GHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow         1262         1236   -2.06%

OpenBSD/i386 (Asus eeePC 701 with Intel Celeron M 900MHz - locked to 631MHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow         5089         5043   -0.90%

NetBSD/i386 (VMware VM with Core i5 CPU @ 2.7GHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          277          278   +0.36%

NetBSD/amd64 (VMware VM with Core i5 CPU @ 2.7Ghz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          103          105   +1.94%

Thanks Maxim Khitrov, Joel Sing, and Dave Cheney for providing benchmark data.

R=jsing, dave, rsc
CC=golang-dev
https://golang.org/cl/6820120
2012-12-18 22:57:25 +08:00
Mikio Hara
0d197251ee net: change ListenUnixgram signature to return UnixConn instead of UDPConn
This CL breaks Go 1 API compatibility but it doesn't matter because
previous ListenUnixgram doesn't work in any use cases, oops.

The public API change is:
-pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
+pkg net, func ListenUnixgram(string, *UnixAddr) (*UnixConn, error)

Fixes #3875.

R=rsc, golang-dev, dave
CC=golang-dev
https://golang.org/cl/6937059
2012-12-16 11:51:47 +09:00
Andrew Gerrand
641d152935 go/doc: hide "Program exited." message from front page playground output
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6934049
2012-12-13 15:35:38 +11:00
Andrew Gerrand
c8ce844d5a doc/play: sync playground.js with go-playground repo
Also add style for "Program exited." message.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6934047
2012-12-13 14:32:03 +11:00
Robert Griesemer
462860bd8d spec: more explicit comments for constant expression examples
Fixes #3814.

R=rsc, iant
CC=golang-dev
https://golang.org/cl/6920057
2012-12-12 14:25:40 -08:00
Robert Griesemer
a9a49fe962 spec: calling delete on a nil map is a no-op
This is language change. It is a backward-compatible
change but for code that relies on a run-time panic
when calling delete on a nil map (unlikely).

Fixes #4253.

R=rsc, r, iant, ken, bradfitz, rogpeppe
CC=golang-dev
https://golang.org/cl/6909060
2012-12-12 13:08:35 -08:00