1
0
mirror of https://github.com/golang/go synced 2024-10-04 12:21:26 -06:00
Commit Graph

179 Commits

Author SHA1 Message Date
Brad Fitzpatrick
25c96cba2e json: remove old optimization that inlining covers now
Benchmarks look the same.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5572080
2012-01-30 11:42:09 -08:00
Gustavo Niemeyer
9c497443ae encoding/xml: fix decoding of xml.Name with sub-elements
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5569090
2012-01-30 16:32:48 -02:00
Russ Cox
0368ca138b build: remove code now in subrepositories
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5569064
2012-01-25 15:30:42 -05:00
Gustavo Niemeyer
66599c4070 encoding/xml: remove Marshaler support
Marshaler has a number of open areas that need
further thought (e.g. it doesn't handle attributes,
it's supposed to handle tag names internally but has
no information to do so, etc).

We're removing it now and will bring it back with an
interface that covers these aspects, after Go 1.

Related to issue 2771, but doesn't fix it.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5574057
2012-01-24 21:51:15 -02:00
Gustavo Niemeyer
e3ab30bbc1 encoding/xml: add docs for ignoring tag
That was supposed to be in the original CL, but missed
the files.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5570052
2012-01-24 21:04:40 -02:00
Brad Fitzpatrick
2c2c20224a encoding/binary: document that PutVarint, PutUvarint may panic
Fixes #2628

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5571058
2012-01-24 14:19:59 -08:00
Gustavo Niemeyer
0442087f93 encoding/xml: bring API closer to other packages
Includes gofix module. The only case not covered should be
xml.Unmarshal, since it remains with a similar interface, and
would require introspecting the type of its first argument
better.

Fixes #2626.

R=golang-dev, rsc, gustavo
CC=golang-dev
https://golang.org/cl/5574053
2012-01-24 01:10:32 -02:00
Rob Pike
a937bff52c gob: annotate debug.go so it's not normally built
So it's not included in the package by the go tool.

R=iant, fullung, rsc
CC=golang-dev
https://golang.org/cl/5563049
2012-01-23 08:40:34 -08:00
Gustavo Niemeyer
5fde5cd5cb encoding/xml: support ignoring fields with "-"
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5564045
2012-01-23 01:34:35 -02:00
Gustavo Niemeyer
fd9c99511e encoding/xml: minor doc fixup
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5564046
2012-01-23 01:32:07 -02:00
Gustavo Niemeyer
57007fe12b encoding/xml: improve []byte handling
Marshalling of []byte in attributes and the general
marshalling of named []byte types was fixed.

A []byte field also won't be nil if an XML element
was mapped to it, even if the element is empty.

Tests were introduced to make sure that *struct{}
fields works correctly for element presence testing.
No changes to the logic made in that regard.

R=rsc
CC=golang-dev
https://golang.org/cl/5539070
2012-01-23 00:50:05 -02:00
Rob Pike
6e1c0df104 gob: reduce the maximum message size
It was 2^31, but that could cause overflow and trouble.
Reduce it to 2^30 and add a TODO.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5562049
2012-01-22 12:01:12 -08:00
Robert Griesemer
0796c1c3ec encoding/varint: deleted WriteXvarint
Fixes #2748.

R=rsc, r, r
CC=golang-dev
https://golang.org/cl/5557072
2012-01-20 12:57:53 -08:00
Gustavo Niemeyer
ca3e6d1367 encoding/xml: marshal/unmarshal xml.Name in field
R=rsc
CC=golang-dev
https://golang.org/cl/5542052
2012-01-19 20:15:55 -02:00
Olivier Duperray
e5c1f3870b pkg: Add & fix Copyright of "hand generated" files
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5554064
2012-01-19 10:14:56 -08:00
Mikio Hara
d4fe9c6a9d encoding/json: fix comments, tweak tests for tag names
R=bradfitz
CC=golang-dev
https://golang.org/cl/5558047
2012-01-19 15:33:29 +09:00
Brad Fitzpatrick
b39c883e29 encoding/json: allow / and % in tag names
Fixes #2718

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5532095
2012-01-18 19:05:15 -08:00
David Symonds
6e285ebade encoding/json: document angle bracket escaping.
Fixes #2643.

R=rsc, d_smithson
CC=golang-dev
https://golang.org/cl/5543068
2012-01-18 12:56:24 +11:00
Gustavo Niemeyer
1627b46eaa xml: major Go 1 fixup
This CL improves the xml package in the following ways:

- makes its interface match established conventions
- brings Marshal and Unmarshal closer together
- fixes a large number of bugs and adds tests
- improves speed significantly
- organizes and simplifies the code

Fixes #2426.
Fixes #2406.
Fixes #1989.

What follows is a detailed list of those changes.

- All matching is case sensitive without special processing
  to the field name or xml tag in an attempt to match them.
  Customize the field tag as desired to match the correct XML
  elements.

- Flags are ",flag" rather than "flag". The names "attr",
  "chardata", etc, may be used to name actual XML elements.

- Overriding of attribute names is possible with "name,attr".

- Attribute fields are marshalled properly if they have
  non-string types. Previously they were unmarshalled, but were
  ignored at marshalling time.

- Comment fields tagged with ",comment" are marshalled properly,
  rather than being marshalled as normal fields.

- The handling of the Any field has been replaced by the ",any"
  flag to avoid unexpected results when using the field name for
  other purposes, and has also been fixed to interact properly
  with name paths. Previously the feature would not function
  if any field in the type had a name path in its tag.

- Embedded struct support fixed and cleaned so it works when
  marshalling and also when using field paths deeper than one level.

- Conflict reporting on field names have been expanded to cover
  all fields. Previously it'd catch only conflicts of paths
  deeper than one level. Also interacts correctly with embedded
  structs now.

- A trailing '>' is disallowed in xml tags. It used to be
  supported for removing the ambiguity between "attr" and "attr>",
  but the marshalling support for that was broken, and it's now
  unnecessary. Use "name" instead of "name>".

- Fixed docs to point out that a XMLName doesn't have to be
  an xml.Name (e.g. a struct{} is a good fit too). The code was
  already working like that.

- Fixed asymmetry in the precedence of XML element names between
  marshalling and unmarshalling. Marshal would consider the XMLName
  of the field type before the field tag, while unmarshalling would
  do the opposite. Now both respect the tag of the XMLName field
  first, and a nice error message is provided in case an attempt
  is made to name a field with its tag in a way that would
  conflict with the underlying type's XMLName field.

- Do not marshal broken "<???>" tags when in doubt. Use the type
  name, and error out if that's not possible.

- Do not break down unmarshalling if there's an interface{} field
  in a struct.

- Significant speed boost due to caching of type metadata and
  overall allocation clean ups. The following timings reflect
  processing of the the atom test data:

  Old:

  BenchmarkMarshal           50000             48798 ns/op
  BenchmarkUnmarshal          5000            357174 ns/op

  New:

  BenchmarkMarshal          100000             19799 ns/op
  BenchmarkUnmarshal         10000            128525 ns/op

R=cw, gustavo, kevlar, adg, rogpeppe, fullung, christoph, rsc
CC=golang-dev
https://golang.org/cl/5503078
2012-01-13 11:05:19 +01:00
Brad Fitzpatrick
b37de7387a json: better error messages when the ,string option is misused
Fixes #2331

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5544045
2012-01-12 14:40:29 -08:00
Alexey Borzenkov
793768e9d5 encoding/gob: fix panic when decoding []byte to incompatible slice types
Fixes #2662.

R=golang-dev, rogpeppe, r, r
CC=golang-dev, r, rogpeppe
https://golang.org/cl/5515050
2012-01-09 12:52:03 -08:00
Florian Weimer
0448ce13a0 encoding/asn1: document support for *big.Int
Also add basic tests.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5533045
2012-01-08 10:02:23 -05:00
Evan Shaw
c20c09251c encoding/json: don't marshal special float values
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5500084
2012-01-03 12:30:18 +11:00
Michael Shields
38ff98b4c6 encoding/xml: use strings.Reader in tests.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5502083
2012-01-03 12:22:02 +11:00
Rob Pike
6b772462e4 panics: use the new facilities of testing.B instead
Lots of panics go away.
Also fix a name error in html/template.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5498045
2011-12-20 10:36:25 -08:00
Roger Peppe
16bf7d9e82 encoding/binary: add more benchmarks
Also add a byte count to the varint benchmarks - this
isn't accurate, of course, but it allows a rough comparison to
the other benchmarks.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5496070
2011-12-20 09:25:47 -08:00
Andrew Gerrand
7bffdc7247 encoding/binary: add Write and Read examples
R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/5495095
2011-12-20 13:16:36 +11:00
Rémy Oudompheng
4a4c39e7d4 encoding/json: cleanup leftover variables in array decoding.
An old update for API changes in reflect package left several
helper variables that do not have a meaning anymore, and
the type checking of arrays vs slices was broken.
Fixes #2513.

R=ultrotter, rsc
CC=golang-dev, remy
https://golang.org/cl/5488094
2011-12-19 15:32:06 -05:00
Andrew Gerrand
5ede9df5a0 encoding/json: examples for Marshal and Unmarshal
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5493075
2011-12-19 11:16:55 +11:00
Robert Griesemer
541b67d051 go/printer, gofmt: fine tuning of line spacing
- no empty lines inside empty structs and interfaces
- top-level declarations are separated by a blank line if
  a) they are of different kind (e.g. const vs type); or
  b) there are documentation comments associated with a
     declaration (this is new)
- applied gofmt -w misc src

The actual changes are in go/printer/nodes.go:397-400 (empty structs/interfaces),
and go/printer/printer.go:307-309 (extra line break). The remaining
changes are cleanups w/o changing the existing functionality.

Fixes issue  2570.

R=rsc
CC=golang-dev
https://golang.org/cl/5493057
2011-12-16 15:43:06 -08:00
Rob Pike
474d64d26e encoding/gob: arrays are zero only if their elements are zero
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5494059
2011-12-16 11:52:58 -08:00
Rob Pike
4fb5f5449a gob: isZero for struct values
Fixes #2577.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5492058
2011-12-16 11:33:57 -08:00
Maxim Pimenov
bf6dd2db04 various: use $GCFLAGS and $GCIMPORTS like Make does
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5489065
2011-12-16 11:31:39 -05:00
Rob Pike
197eb8f7c3 govet: add checking for printf verbs
Also fix the errors it catches.

Fixes #1654.

R=rsc
CC=golang-dev
https://golang.org/cl/5489060
2011-12-15 15:17:52 -08:00
Brad Fitzpatrick
29264c6f4f json: use strconv.Append variants to avoid allocations in encoding
Before/after, best of 3:
json.BenchmarkCodeEncoder  10  183495300 ns/op  10.58 MB/s
->
json.BenchmarkCodeEncoder  10  133025100 ns/op  14.59 MB/s

But don't get too excited about this.  These benchmarks, while
stable at any point of time, fluctuate wildly with any line of
code added or removed anywhere in the path due to stack splitting
issues.

It's currently much faster, though, and this is the API that
doesn't allocate so should always be faster in theory.

R=golang-dev, dsymonds, rsc, r, gri
CC=golang-dev
https://golang.org/cl/5411052
2011-12-15 11:21:21 -08:00
Brad Fitzpatrick
f89b5746fb json: some tests to demonstrate bad error messages
Not a fix yet (help wanted), but part of Issue 2331

R=rsc
CC=golang-dev
https://golang.org/cl/5490043
2011-12-15 10:02:47 -08:00
Rob Pike
34c7765fe5 json: treat renamed byte slices the same as []byte
Fixes #2163.

R=rsc
CC=golang-dev
https://golang.org/cl/5488068
2011-12-14 11:03:28 -08:00
Rob Pike
ba576b2b48 encoding/gob: better error messages when types mismatch
The transmitter must encode an interface value if it is to be decoded
into an interface value, but it's a common and confusing error to
encode a concrete value and attempt to decode it into an interface,
particularly *interface{}. This CL attempts to explain things better.

Fixes #2367.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5485072
2011-12-13 20:40:55 -08:00
Russ Cox
2666b815a3 use new strconv API
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.

No attempt is made to use the new Append functions
even though there are definitely opportunities.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
2011-12-05 15:48:46 -05:00
Russ Cox
434a6c85cb gc: use gofmt spacing when printing map type
R=ken2
CC=golang-dev
https://golang.org/cl/5450071
2011-12-02 14:45:07 -05:00
Russ Cox
dcf1d7bc0e gofmt -s misc src
R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/5451079
2011-12-02 14:14:25 -05:00
Robert Hencke
6f0ef845e6 asn1: fix incorrect prints found by govet
R=golang-dev
CC=golang-dev
https://golang.org/cl/5449063
2011-12-02 10:13:02 -05:00
Rob Pike
30775f67e7 encoding/gob: don't send type info for unexported fields
Fixes #2517.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5440079
2011-12-02 00:02:24 -08:00
Russ Cox
e812db3558 encoding/asn1: fix test on OpenBSD
time.Parse uses time.Local if it has the right zone offset,
otherwise it calls time.FixedZone.  The test's use of reflect.DeepEqual
meant that the test expected time.FixedZone always, failing
when the local time zone really would have used -0700 for
that time.  The fix is to format the time to display only the
pieces we intend to test.

R=golang-dev, agl, iant
CC=golang-dev
https://golang.org/cl/5437088
2011-11-30 13:36:25 -05:00
Russ Cox
03823b881c use new time API
R=bradfitz, gri, r, dsymonds
CC=golang-dev
https://golang.org/cl/5390042
2011-11-30 12:01:46 -05:00
Russ Cox
fe838c2ddb encoding/xml: fix copy bug
Fixes #2484.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5417059
2011-11-22 12:31:33 -05:00
Russ Cox
6e3e380923 allow direct conversion between string and named []byte, []rune
The allowed conversions before and after are:
        type Tstring string
        type Tbyte []byte
        type Trune []rune

        string <-> string  // ok
        string <-> []byte  // ok
        string <-> []rune // ok
        string <-> Tstring // ok
        string <-> Tbyte // was illegal, now ok
        string <-> Trune // was illegal, now ok

        Tstring <-> string  // ok
        Tstring <-> []byte  // ok
        Tstring <-> []rune // ok
        Tstring <-> Tstring // ok
        Tstring <-> Tbyte // was illegal, now ok
        Tstring <-> Trune // was illegal, now ok

Update spec, compiler, tests.  Use in a few packages.

We agreed on this a few months ago but never implemented it.

Fixes #1707.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5421057
2011-11-22 12:30:02 -05:00
Brad Fitzpatrick
6c9f466273 json: speed up encoding, caching reflect calls
Before
json.BenchmarkCodeEncoder  10  181232100 ns/op  10.71 MB/s
json.BenchmarkCodeMarshal  10  184578000 ns/op  10.51 MB/s

After:
json.BenchmarkCodeEncoder  10  146444000 ns/op  13.25 MB/s
json.BenchmarkCodeMarshal  10  151428500 ns/op  12.81 MB/s

R=rsc, r
CC=golang-dev
https://golang.org/cl/5416046
2011-11-21 07:49:14 -08:00
Russ Cox
a6106eef37 encoding/json: make BenchmarkSkipValue more consistent
Move scanner allocation out of loop.
It's the only allocation in the test so it dominates
when it triggers a garbage collection.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5369117
2011-11-15 13:59:59 -05:00
Russ Cox
552a556a40 encoding/json: add marshal/unmarshal benchmark
R=bradfitz
CC=golang-dev
https://golang.org/cl/5387041
2011-11-15 10:58:19 -05:00
Mikio Hara
a619da9f4a xml: fix build
empty is already not a nil.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5376098
2011-11-15 10:28:01 +09:00
Russ Cox
53523f6a7d encoding/json: decode [] as empty slice, not nil slice
Test was already present, but bug in reflect.DeepEqual hid this bug.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5375090
2011-11-14 16:03:23 -05:00
Russ Cox
558e7fc332 various: avoid func compare
R=gri, r, bradfitz
CC=golang-dev
https://golang.org/cl/5371074
2011-11-13 22:57:19 -05:00
Russ Cox
fd34e78b53 various: reduce overuse of os.EINVAL + others
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5372081
2011-11-13 22:42:42 -05:00
Rob Pike
30aa701fec renaming_2: gofix -r go1pkgrename src/pkg/[a-l]*
R=rsc
CC=golang-dev
https://golang.org/cl/5358041
2011-11-08 15:40:58 -08:00
Rob Pike
6ab6c49fce renaming_1: hand-edited files for go 1 renaming
This contains the files that required handiwork, mostly
Makefiles with updated TARGs, plus the two packages
with modified package names.
html/template/doc.go needs a separate edit pass.
test/fixedbugs/bug358.go is not legal go so gofix fails on it.

R=rsc
CC=golang-dev
https://golang.org/cl/5340050
2011-11-08 15:38:47 -08:00
David Crawshaw
1371ac2f0b xml: allow parsing of <_> </_>.
R=rsc, nigeltao
CC=golang-dev
https://golang.org/cl/5298061
2011-11-07 10:47:44 -05:00
Luuk van Dijk
aac144b120 gc: detect type switch variable not used cases.
Fixes #873
Fixes #2162

R=rsc
CC=golang-dev
https://golang.org/cl/5341043
2011-11-04 17:03:50 +01:00
Rob Pike
88cf76a9b3 gob: fix bug when registering the same type multiple times
Need to compare user type, not base type.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5340041
2011-11-03 18:05:14 -07:00
Vincent Vanackere
eb1717e035 all: rename os.EOF to io.EOF in various non-code contexts
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5334050
2011-11-03 14:01:30 -07:00
Rob Pike
f4cd80224a encoding: move asn1, csv, gob, json, xml into encoding
This is Go 1 package renaming CL #1.
This one merely moves the source; the import strings will be
changed after the next weekly release.

The only edits are in Makefiles.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5331060
2011-11-03 11:39:52 -07:00
Russ Cox
965845a86d all: sort imports
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072
2011-11-02 15:54:16 -04:00
Russ Cox
c2049d2dfe src/pkg/[a-m]*: gofix -r error -force=error
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5322051
2011-11-01 22:04:37 -04:00
Russ Cox
7f91a39d3d encoding/binary: fix type in test
Was working only accidentally.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5303082
2011-10-27 19:38:57 -07:00
Robert Griesemer
f7467e85e1 encoding/binary: added benchmarks
binary.BenchmarkPutUvarint32 20000000	 85.6 ns/op
binary.BenchmarkPutUvarint64 10000000	299   ns/op

R=rsc
CC=golang-dev
https://golang.org/cl/5148049
2011-10-05 13:04:43 -07:00
Robert Griesemer
61cc8728fb encoding/binary: PutX functions require buffer of sufficient size.
R=rsc
CC=golang-dev
https://golang.org/cl/5163041
2011-09-29 09:40:59 -07:00
Robert Griesemer
f30719dc89 encoding/binary: support for varint encoding
R=rsc, r, nigeltao, r, dsymonds
CC=golang-dev
https://golang.org/cl/5146048
2011-09-28 22:36:52 -07:00
Robert Griesemer
90564a9256 go/printer: changed max. number of newlines from 3 to 2
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go
(cd src/cmd/gofix/testdata; gofmt -w *.in *.out)
(cd src/pkg/go/printer; gotest -update)
gofmt -w misc src

runs all tests

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4715041
2011-07-14 14:39:40 -07:00
Brad Fitzpatrick
dcdaeebdfb docs: fix wrong it's -> its
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/4702046
2011-07-13 10:54:51 -07:00
Russ Cox
21e75da486 respect goto restrictions
R=gri
CC=golang-dev
https://golang.org/cl/4625044
2011-06-17 06:07:13 -04:00
Adam Langley
c72dbaf312 encoding/hex: don't try to print DEL.
R=agl
CC=golang-dev
https://golang.org/cl/4551081
2011-05-31 15:40:33 -04:00
Adam Langley
de15f6165e encoding/hex: add hex dumping.
I found this useful, esp with an io.MultiWriter. But I fear that
it may be bloat in such a low-level package so please feel free to
decline if you feel likewise.

R=rsc, ality
CC=golang-dev
https://golang.org/cl/4530088
2011-05-31 12:58:09 -04:00
Brad Fitzpatrick
f7a266a5aa encoding/binary: add a non-reflect fast path for Write
before/after:
binary.BenchmarkWrite	  100000	     18312 ns/op
binary.BenchmarkWrite	  500000	      4468 ns/op

R=rsc, gri
CC=golang-dev
https://golang.org/cl/4515154
2011-05-27 16:29:33 -07:00
Brad Fitzpatrick
3648a03b3a encoding/binary: add a non-reflect fast path for Read
before/after:
binary.BenchmarkRead  200000     10860 ns/op
binary.BenchmarkRead  500000      2846 ns/op

R=rsc
CC=golang-dev
https://golang.org/cl/4547062
2011-05-26 09:01:05 -07:00
Brad Fitzpatrick
1b6bf88767 encoding/base64: add DecodeString and EncodeToString
... like encoding/hex. Same signatures.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4530070
2011-05-25 12:24:36 -07:00
Rob Pike
b3d3762b2e encoding/line: delete package.
Its functionality is now in bufio.
Fixes #1869.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4553061
2011-05-24 16:05:26 +10:00
Robert Hencke
c8727c81bb pkg: spelling tweaks, A-H
R=ality, bradfitz, rsc, dsymonds, adg, qyzhai, dchest
CC=golang-dev
https://golang.org/cl/4536063
2011-05-18 13:14:56 -04:00
Russ Cox
07abf1c732 fix tree for reflect rename
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4435067
2011-04-25 13:39:36 -04:00
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
Russ Cox
4c006182dc pkg: manual cleanup of some gofixed code
R=golang-dev, niemeyer, r
CC=golang-dev
https://golang.org/cl/4372052
2011-04-13 23:36:00 -04:00
Russ Cox
db5c5d6fa6 update go tree for reflect changes
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4353043
2011-04-08 12:27:58 -04:00
Adam Langley
5311d915f4 encoding/line: fix line returned after EOF
Fixes #1509.

R=r
CC=golang-dev
https://golang.org/cl/4167045
2011-02-15 09:52:20 -05:00
Andrew Gerrand
4774a19530 encoding/binary: update package doc string to be more comprehensive
R=r
CC=golang-dev
https://golang.org/cl/4128060
2011-02-11 06:56:31 +11:00
Brad Fitzpatrick
3aee82b660 encoding/line: make it an io.Reader too
R=agl1, bradfitzwork, rsc
CC=golang-dev
https://golang.org/cl/4066043
2011-01-26 09:59:53 -05:00
Rob Pike
4871d0d19a encoding/line: fix up a few typos and infelicities in the doc comments
R=anschelsc, agl1
CC=golang-dev
https://golang.org/cl/3988045
2011-01-24 10:19:23 -08:00
Miek Gieben
40c7449044 encoding/base32: new package
R=rsc
CC=Miek Gieben, golang-dev
https://golang.org/cl/3926041
2011-01-20 12:51:15 -05:00
Russ Cox
f2b5a07453 delete float, complex - code changes
also:
	cmplx -> complex
	float64(1.0) -> 1.0
	float64(1) -> 1.0

R=gri, r, gri1, r2
CC=golang-dev
https://golang.org/cl/3991043
2011-01-19 23:09:00 -05:00
Rob Pike
699864b696 encoding/line: fix error call (missing argument)
R=agl1, rsc
CC=golang-dev
https://golang.org/cl/3861044
2011-01-12 00:25:29 -08:00
Adam Langley
66a45b486b encoding/line: add
I needed a way to read lines without worrying about \n and \r\n.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2859041
2011-01-08 10:29:37 -05:00
Patrick Gavlin
236f9638b4 encoding/binary: reject types with implementation-dependent sizes
Fixes #1201.

R=rsc
CC=golang-dev
https://golang.org/cl/3787044
2011-01-04 13:42:50 -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
Russ Cox
1451695f86 encoding/binary: give LittleEndian, BigEndian specific types
Giving them specific types has the benefit that
binary.BigEndian.Uint32(b) is now a direct call, not an
indirect via a mutable interface value, so it can potentially
be inlined.

Recent changes to the spec relaxed the rules for comparison,
so this code is still valid:

	func isLittle(o binary.ByteOrder) { return o == binary.LittleEndian }

The change does break this potential idiom:

	o := binary.BigEndian
	if foo {
		o = binary.LittleEndian
	}

That must rewrite to give o an explicit binary.ByteOrder type.
On balance I think the benefit from the direct call and inlining
outweigh the cost of breaking that idiom.

R=r, r2
CC=golang-dev
https://golang.org/cl/2427042
2010-10-21 11:25:14 -04:00
Russ Cox
10b53867e8 encoding/hex: fix typo
Thanks to avadh4all for spotting it.

Fixes #1214.

R=r, r2
CC=golang-dev
https://golang.org/cl/2616041
2010-10-20 16:38:57 -04:00
Russ Cox
2ee420fa5e ... changes
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/2273042
2010-09-24 11:55:48 -04: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
Roger Peppe
b92db49c26 encoding/binary: add complex
R=rsc
CC=golang-dev
https://golang.org/cl/1879043
2010-08-06 16:44:38 -07:00
Russ Cox
36560d2b4a pem: print \n after 1 header line too
rearrange to make reason for if clear.

Fixes #911.

R=agl1
CC=golang-dev
https://golang.org/cl/1774044
2010-07-12 16:48:49 -07:00
Russ Cox
45bdf0367e reflect: add Kind, remove Int8Type, Int8Value, etc.
update other code to match.

R=r
CC=golang-dev
https://golang.org/cl/1680044
2010-06-20 12:16:25 -07: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
Giles Lean
0ed8231e69 encoding/base64: fix typo in comment
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/258041
2010-03-08 18:12:25 -08:00