Each package using struct field tags assumes that
it is the only package storing data in the tag.
This CL adds support in package reflect for sharing
tags between multiple packages. In this scheme, the
tags must be of the form
key:"value" key2:"value2"
(raw strings help when writing that tag in Go source).
reflect.StructField's Tag field now has type StructTag
(a string type), which has method Get(key string) string
that returns the associated value.
Clients of json and xml will need to be updated.
Code that says
type T struct {
X int "name"
}
should become
type T struct {
X int `json:"name"` // or `xml:"name"`
}
Use govet to identify struct tags that need to be changed
to use the new syntax.
R=r, r, dsymonds, bradfitz, kevlar, fvbommel, n13m3y3r
CC=golang-dev
https://golang.org/cl/4645069
This is a core API change.
1) gofix misc src
2) Manual adjustments to the following files under src/pkg:
gob/decode.go
rpc/client.go
os/error.go
io/io.go
bufio/bufio.go
http/request.go
websocket/client.go
as well as:
src/cmd/gofix/testdata/*.go.in (reverted)
test/fixedbugs/bug243.go
3) Implemented gofix patch (oserrorstring.go) and test case (oserrorstring_test.go)
Compiles and runs all tests.
R=r, rsc, gri
CC=golang-dev
https://golang.org/cl/4607052
This CL introduces new API into package net to identify the network
interface. A functionality of new API is very similar to RFC3493 -
"Interface Identification".
R=r, gri, bradfitz, robert.hencke, fullung, rsc
CC=golang-dev
https://golang.org/cl/4437087
Add IPv6Mreq and Inet6Pktinfo for specifying the network interface.
Rename IpMreq to IPMreq, SetsockoptIpMreq to SetsockoptIPMreq.
R=rsc, dave, robert.hencke
CC=golang-dev
https://golang.org/cl/4532098
Using the getaddrinfo order is only okay if we
are smart enough to try multiple addresses in Dial.
Since the code does not do that, we must make
the right first choice, regardless of what getaddrinfo
does, and more often that not that means using the
IPv4 address, even on IPv6 systems. With the CL
applied, gotest fails in package net on OS X.
helix.cam=; gotest
...
--- FAIL: net.TestDialGoogleIPv4 (1.05 seconds)
-- 74.125.226.179:80 --
-- www.google.com:80 --
Dial("tcp", "", "www.google.com:80") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family
-- 74.125.226.179:http --
-- www.google.com:http --
Dial("tcp", "", "www.google.com:http") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family
-- 074.125.226.179:0080 --
-- [::ffff:74.125.226.179]:80 --
-- [::ffff:4a7d:e2b3]:80 --
-- [0:0:0:0:0000:ffff:74.125.226.179]:80 --
-- [0:0:0:0:000000:ffff:74.125.226.179]:80 --
-- [0:0:0:0:0:ffff::74.125.226.179]:80 --
FAIL
gotest: "./6.out" failed: exit status 1
««« original CL description
net: name-based destination address selection
getaddrinfo() orders the addresses according to RFC 3484.
This means when IPv6 is working on a host we get results like:
[]string = {"2001:4810::110", "66.117.47.214"}
and when it's not working we get:
[]string = {"66.117.47.214", "2001:4810::110"}
thus can drop firstFavoriteAddr.
This also means /etc/gai.conf works on relevant systems.
R=rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/4557058
»»»
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4532101
getaddrinfo() orders the addresses according to RFC 3484.
This means when IPv6 is working on a host we get results like:
[]string = {"2001:4810::110", "66.117.47.214"}
and when it's not working we get:
[]string = {"66.117.47.214", "2001:4810::110"}
thus can drop firstFavoriteAddr.
This also means /etc/gai.conf works on relevant systems.
R=rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/4557058
This CL will help to make an adaptive address family
selection possible when an any address family, vague
network string such as "ip", "tcp" or "udp" is passed
to Dial and Listen API.
Fixes#1769.
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4438066
On Mac X 10.6 /etc/resolv.conf is changed dynamically,
and may not exist at all when all network connections
are turned off, thus any lookup, even for "localhost"
would fail with "error reading DNS config: open
/etc/resolv.conf: no such file or directory". This
change avoids the error by trying to lookup addresses
in /etc/hosts before loading DNS config.
R=golang-dev, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4431054
This CL makes it possible to resolve DNS names on OS X
without offending the Application-Level Firewall.
It also means that cross-compiling from one operating
system to another is no longer possible when using
package net, because cgo needs to be able to sniff around
the local C libraries. We could special-case this one use
and check in generated files, but it seems more trouble
than it's worth. Cross compiling is dead anyway.
It is still possible to use either GOARCH=amd64 or GOARCH=386
on typical Linux and OS X x86 systems.
It is also still possible to build GOOS=linux GOARCH=arm on
any system, because arm is for now excluded from this change
(there is no cgo for arm yet).
R=iant, r, mikioh
CC=golang-dev
https://golang.org/cl/4437053
We replace the current Open with:
OpenFile(name, flag, perm) // same as old Open
Open(name) // same as old Open(name, O_RDONLY, 0)
Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666)
This CL includes a gofix module and full code updates: all.bash passes.
(There may be a few comments I missed.)
The interesting packages are:
gofix
os
Everything else is automatically generated except for hand tweaks to:
src/pkg/io/ioutil/ioutil.go
src/pkg/io/ioutil/tempfile.go
src/pkg/crypto/tls/generate_cert.go
src/cmd/goyacc/goyacc.go
src/cmd/goyacc/units.y
R=golang-dev, bradfitzwork, rsc, r2
CC=golang-dev
https://golang.org/cl/4357052