An error occurred fetching the project authors.
- 18 Oct, 2011 1 commit
-
-
David Symonds authored
There's a problem that is manifesting on the 386 builders, but this test bug is masking it. R=adg CC=golang-dev https://golang.org/cl/5295042
-
- 17 Oct, 2011 1 commit
-
-
Russ Cox authored
Had been allowing it for use by fmt, but it is too hard to lock down. Fix other packages not to depend on it. R=r, r CC=golang-dev https://golang.org/cl/5266054
-
- 24 Aug, 2011 1 commit
-
-
Russ Cox authored
This allows code that wants to handle []byte separately to get at the actual slice instead of just at individual bytes. It seems to come up often enough. R=r CC=golang-dev https://golang.org/cl/4942051
-
- 22 Aug, 2011 1 commit
-
-
Rob Pike authored
It's not even using vectors - the references are just examples. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/4938043
-
- 27 Jul, 2011 2 commits
-
-
David Symonds authored
R=nigeltao CC=golang-dev https://golang.org/cl/4825050
-
David Symonds authored
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4802061
-
- 14 Jul, 2011 1 commit
-
-
Robert Griesemer authored
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
-
- 29 Jun, 2011 2 commits
-
-
Russ Cox authored
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
-
Rob Pike authored
It's more common to ask for methods by name than by index, so might as well make it easy to do so. R=rsc CC=golang-dev https://golang.org/cl/4639083
-
- 17 May, 2011 1 commit
-
-
Rob Pike authored
When GOMAXPROCS>1, the testing framework runs in parallel with the test itself and may do a small number of allocations, so allow the "noAllocs" condition to admit just a few. Fixes #1782. R=rsc CC=golang-dev, rsc https://golang.org/cl/4533041
-
- 03 May, 2011 1 commit
-
-
Russ Cox authored
Fixes #1748. R=golang-dev, r CC=golang-dev https://golang.org/cl/4444087
-
- 28 Apr, 2011 1 commit
-
-
Gustavo Niemeyer authored
Also remove some left over copy & paste in the test of reflect.Copy for arrays. R=golang-dev, rsc1 CC=golang-dev https://golang.org/cl/4431074
-
- 27 Apr, 2011 1 commit
-
-
Gustavo Niemeyer authored
R=golang-dev, rsc1 CC=golang-dev https://golang.org/cl/4438077
-
- 25 Apr, 2011 1 commit
-
-
Russ Cox authored
R=r, bradfitzgo CC=golang-dev https://golang.org/cl/4433066
-
- 21 Apr, 2011 1 commit
-
-
Russ Cox authored
go/types: update for export data format change reflect: require package qualifiers to match during interface check runtime: require package qualifiers to match during interface check test: fixed bug324, adapt to be silent Fixes #1550. Issue 1536 remains open. R=gri, ken2, r CC=golang-dev https://golang.org/cl/4442071
-
- 20 Apr, 2011 1 commit
-
-
Russ Cox authored
This CL makes reflect require that values be assignable to the target type in exactly the same places where that is the rule in Go. It also adds the Implements and AssignableTo methods so that callers can check the types themselves so as to avoid a panic. Before this CL, reflect required strict type identity. This CL expands Call to accept and correctly marshal arbitrary argument lists for variadic functions; it introduces CallSlice for use in the case where the slice for the variadic argument is already known. Fixes #327. Fixes #1212. R=r, dsymonds CC=golang-dev https://golang.org/cl/4439058
-
- 19 Apr, 2011 1 commit
-
-
Russ Cox authored
R=r CC=golang-dev https://golang.org/cl/4444049
-
- 18 Apr, 2011 1 commit
-
-
Russ Cox authored
* Reduces malloc counts during gob encoder/decoder test from 6/6 to 3/5. The current reflect uses Set to mean two subtly different things. (1) If you have a reflect.Value v, it might just represent itself (as in v = reflect.NewValue(42)), in which case calling v.Set only changed v, not any other data in the program. (2) If you have a reflect Value v derived from a pointer or a slice (as in x := []int{42}; v = reflect.NewValue(x).Index(0)), v represents the value held there. Changing x[0] affects the value returned by v.Int(), and calling v.Set affects x[0]. This was not really by design; it just happened that way. The motivation for the new reflect implementation was to remove mallocs. The use case (1) has an implicit malloc inside it. If you can do: v := reflect.NewValue(0) v.Set(42) i := v.Int() // i = 42 then that implies that v is referring to some underlying chunk of memory in order to remember the 42; that is, NewValue must have allocated some memory. Almost all the time you are using reflect the goal is to inspect or to change other data, not to manipulate data stored solely inside a reflect.Value. This CL removes use case (1), so that an assignable reflect.Value must always refer to some other piece of data in the program. Put another way, removing this case would make v := reflect.NewValue(0) v.Set(42) as illegal as 0 = 42. It would also make this illegal: x := 0 v := reflect.NewValue(x) v.Set(42) for the same reason. (Note that right now, v.Set(42) "succeeds" but does not change the value of x.) If you really wanted to make v refer to x, you'd start with &x and dereference it: x := 0 v := reflect.NewValue(&x).Elem() // v = *&x v.Set(42) It's pretty rare, except in tests, to want to use NewValue and then call Set to change the Value itself instead of some other piece of data in the program. I haven't seen it happen once yet while making the tree build with this change. For the same reasons, reflect.Zero (formerly reflect.MakeZero) would also return an unassignable, unaddressable value. This invalidates the (awkward) idiom: pv := ... some Ptr Value we have ... v := reflect.Zero(pv.Type().Elem()) pv.PointTo(v) which, when the API changed, turned into: pv := ... some Ptr Value we have ... v := reflect.Zero(pv.Type().Elem()) pv.Set(v.Addr()) In both, it is far from clear what the code is trying to do. Now that it is possible, this CL adds reflect.New(Type) Value that does the obvious thing (same as Go's new), so this code would be replaced by: pv := ... some Ptr Value we have ... pv.Set(reflect.New(pv.Type().Elem())) The changes just described can be confusing to think about, but I believe it is because the old API was confusing - it was conflating two different kinds of Values - and that the new API by itself is pretty simple: you can only Set (or call Addr on) a Value if it actually addresses some real piece of data; that is, only if it is the result of dereferencing a Ptr or indexing a Slice. If you really want the old behavior, you'd get it by translating: v := reflect.NewValue(x) into v := reflect.New(reflect.Typeof(x)).Elem() v.Set(reflect.NewValue(x)) Gofix will not be able to help with this, because whether and how to change the code depends on whether the original code meant use (1) or use (2), so the developer has to read and think about the code. You can see the effect on packages in the tree in https://golang.org/cl/4423043/. R=r CC=golang-dev https://golang.org/cl/4435042
-
- 08 Apr, 2011 1 commit
-
-
Russ Cox authored
Type is now an interface that implements all the possible type methods. Instead of a type switch on a reflect.Type t, switch on t.Kind(). If a method is invoked on the wrong kind of type (for example, calling t.Field(0) when t.Kind() != Struct), the call panics. There is one method renaming: t.(*ChanType).Dir() is now t.ChanDir(). Value is now a struct value that implements all the possible value methods. Instead of a type switch on a reflect.Value v, switch on v.Kind(). If a method is invoked on the wrong kind of value (for example, calling t.Recv() when t.Kind() != Chan), the call panics. Since Value is now a struct, not an interface, its zero value cannot be compared to nil. Instead of v != nil, use v.IsValid(). Instead of other uses of nil as a Value, use Value{}, the zero value. Many methods have been renamed, most due to signature conflicts: OLD NEW v.(*ArrayValue).Elem v.Index v.(*BoolValue).Get v.Bool v.(*BoolValue).Set v.SetBool v.(*ChanType).Dir v.ChanDir v.(*ChanValue).Get v.Pointer v.(*ComplexValue).Get v.Complex v.(*ComplexValue).Overflow v.OverflowComplex v.(*ComplexValue).Set v.SetComplex v.(*FloatValue).Get v.Float v.(*FloatValue).Overflow v.OverflowFloat v.(*FloatValue).Set v.SetFloat v.(*FuncValue).Get v.Pointer v.(*InterfaceValue).Get v.InterfaceData v.(*IntValue).Get v.Int v.(*IntValue).Overflow v.OverflowInt v.(*IntValue).Set v.SetInt v.(*MapValue).Elem v.MapIndex v.(*MapValue).Get v.Pointer v.(*MapValue).Keys v.MapKeys v.(*MapValue).SetElem v.SetMapIndex v.(*PtrValue).Get v.Pointer v.(*SliceValue).Elem v.Index v.(*SliceValue).Get v.Pointer v.(*StringValue).Get v.String v.(*StringValue).Set v.SetString v.(*UintValue).Get v.Uint v.(*UintValue).Overflow v.OverflowUint v.(*UintValue).Set v.SetUint v.(*UnsafePointerValue).Get v.Pointer v.(*UnsafePointerValue).Set v.SetPointer Part of the motivation for this change is to enable a more efficient implementation of Value, one that does not allocate memory during most operations. To reduce the size of the CL, this CL's implementation is a wrapper around the old API. Later CLs will make the implementation more efficient without changing the API. Other CLs to be submitted at the same time as this one add support for this change to gofix (4343047) and update the Go source tree (4353043). R=gri, iant, niemeyer, r, rog, gustavo, r2 CC=golang-dev https://golang.org/cl/4281055
-
- 11 Mar, 2011 1 commit
-
-
Russ Cox authored
R=golang-dev, rog, bradfitzwork, r CC=golang-dev https://golang.org/cl/4243072
-
- 03 Mar, 2011 1 commit
-
-
Russ Cox authored
This change makes it possible to take the address of a struct field or slice element in order to call a method that requires a pointer receiver. Existing code that uses the Value.Addr method will have to change (as gob does in this CL) to call UnsafeAddr instead. R=r, rog CC=golang-dev https://golang.org/cl/4239052
-
- 20 Jan, 2011 1 commit
-
-
Russ Cox authored
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
-
- 15 Dec, 2010 1 commit
-
-
Nigel Tao authored
R=r CC=golang-dev https://golang.org/cl/3642041
-
- 14 Dec, 2010 1 commit
-
-
Nigel Tao authored
R=r, nigeltao_gnome, rog, niemeyer CC=golang-dev https://golang.org/cl/3529042
-
- 12 Dec, 2010 1 commit
-
-
Nigel Tao authored
R=r CC=golang-dev https://golang.org/cl/3601041
-
- 07 Dec, 2010 1 commit
-
-
Rob Pike authored
I have written a tool to verify Printf calls, and although it's not ready to be reviewed yet it's already uncovered a spate of problems in the repository. I'm sending this CL to break the changes into pieces; as the tool improves it will find more, I'm sure. R=rsc CC=golang-dev https://golang.org/cl/3427043
-
- 22 Oct, 2010 1 commit
-
-
Robert Griesemer authored
R=r, rsc CC=golang-dev https://golang.org/cl/2662041
-
- 28 Sep, 2010 1 commit
-
-
Russ Cox authored
Fixes #451. Fixes #770. R=ken2 CC=golang-dev https://golang.org/cl/2207045
-
- 27 Sep, 2010 1 commit
-
-
Russ Cox authored
Fixes #906. R=ken2 CC=golang-dev https://golang.org/cl/2279042
-
- 17 Aug, 2010 1 commit
-
-
Robert Griesemer authored
(Argument: For any *PtrValue p, it should always be possible to do: p.PointTo(p.Elem()), even if p.Elem() is nil.) Fixes #1028. R=rsc CC=golang-dev, r https://golang.org/cl/1938044
-
- 03 Aug, 2010 1 commit
-
-
Russ Cox authored
R=ken2 CC=golang-dev https://golang.org/cl/1731057
-
- 20 Jun, 2010 1 commit
-
-
Russ Cox authored
update other code to match. R=r CC=golang-dev https://golang.org/cl/1680044
-
- 14 Jun, 2010 1 commit
-
-
Russ Cox authored
R=r CC=golang-dev https://golang.org/cl/1662041
-
- 21 Apr, 2010 1 commit
-
-
Russ Cox authored
R=r CC=golang-dev https://golang.org/cl/823048
-
- 24 Feb, 2010 1 commit
-
-
Robert Griesemer authored
- add extra test cases to go/printer tests - apply gofmt to src and misc R=rsc CC=golang-dev https://golang.org/cl/223041
-
- 26 Jan, 2010 1 commit
-
-
Russ Cox authored
also allow func() func(). R=ken2 CC=golang-dev https://golang.org/cl/194078
-
- 25 Jan, 2010 1 commit
-
-
Russ Cox authored
detect compilation of special package runtime with compiler flag instead of package name. R=ken2 CC=golang-dev https://golang.org/cl/193080
-
- 15 Dec, 2009 1 commit
-
-
Robert Griesemer authored
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 4th set of files. R=rsc CC=golang-dev https://golang.org/cl/180049
-
- 10 Nov, 2009 1 commit
-
-
Robert Griesemer authored
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
-
- 09 Nov, 2009 1 commit
-
-
Robert Griesemer authored
R=rsc, r http://go/go-review/1025029
-