1
0
mirror of https://github.com/golang/go synced 2024-10-03 16:41:28 -06:00
Commit Graph

46 Commits

Author SHA1 Message Date
Russ Cox
7732d80ceb misc cleanup
R=r
http://go/go-review/1016017
2009-11-01 09:25:55 -08:00
Adam Langley
a8a678fc2a Add SetValue(Value) to the Value interface.
R=rsc
APPROVED=rsc
DELTA=172  (170 added, 0 deleted, 2 changed)
OCL=35969
CL=35980
2009-10-21 19:51:27 -07:00
Russ Cox
91549438d8 apply gofmt to rand reflect regexp rpc runtime sort strconv strings sync syscall testing time unicode unsafe utf8
R=gri
DELTA=1409  (79 added, 24 deleted, 1306 changed)
OCL=35415
CL=35437
2009-10-07 11:55:06 -07:00
Russ Cox
6f1698774d undo 35108 (disallow parens around type in struct literal).
allow parens around [...]int in struct literal.

R=ken
OCL=35112
CL=35130
2009-09-29 21:21:14 -07:00
Russ Cox
9c3c140984 disallow parens around type in struct literal syntax,
per discussion with gri.

R=ken
OCL=35108
CL=35108
2009-09-29 16:05:44 -07:00
Russ Cox
20011bc878 unused imports
R=r
OCL=34731
CL=34731
2009-09-17 10:27:04 -07:00
Russ Cox
ca6a0fee1b more "declared and not used".
the last round omitted := range and only
checked 1 out of N vars in a multi-var :=

R=r
OCL=34624
CL=34638
2009-09-15 09:41:59 -07:00
Russ Cox
28eba4877b fix "declared and not used" errors in non-test code.
R=r
DELTA=112  (6 added, 57 deleted, 49 changed)
OCL=34610
CL=34610
2009-09-14 17:20:29 -07:00
Russ Cox
33be0c6465 nil in DeepEqual
R=r
DELTA=13  (5 added, 6 deleted, 2 changed)
OCL=34337
CL=34343
2009-09-03 15:45:43 -07:00
Ian Lance Taylor
8ce468ea2f Restore comment line accidentally dropped in CL 33097.
R=rsc
DELTA=1  (1 added, 0 deleted, 0 changed)
OCL=33891
CL=33891
2009-08-26 14:40:34 -07:00
Russ Cox
de7920e6fd finish ChanValue: Len and Cap.
R=r
DELTA=45  (45 added, 0 deleted, 0 changed)
OCL=33873
CL=33881
2009-08-26 12:42:22 -07:00
Russ Cox
653cef1ba0 add Close() and Closed() to ChanValue
R=r
DELTA=60  (56 added, 3 deleted, 1 changed)
OCL=33868
CL=33872
2009-08-26 10:47:18 -07:00
Russ Cox
92543daff1 change reflect test to avoid bug132
R=gri
DELTA=20  (17 added, 0 deleted, 3 changed)
OCL=33793
CL=33802
2009-08-24 17:04:12 -07:00
Robert Griesemer
c36fbdf713 - fix for multiple fields at same depth error
R=rsc
DELTA=9  (5 added, 0 deleted, 4 changed)
OCL=33768
CL=33785
2009-08-24 15:45:51 -07:00
Russ Cox
b5c57fea96 delete forward type declarations
R=r
DELTA=163  (1 added, 149 deleted, 13 changed)
OCL=33106
CL=33111
2009-08-12 14:40:47 -07:00
Russ Cox
3b864e4195 convert low-level (used by testing) packages to
whole-package compilation.  new Makefiles,
tests now in separate package

	bytes
	flag
	fmt
	io
	math
	once
	os
	reflect
	strconv
	sync
	time
	utf8

delete import "xxx" in package xxx.

inside package xxx, xxx is not declared
anymore so s/xxx.//g

delete file and package level forward declarations.

note the new internal_test.go and sync
and strconv to provide public access to
internals during testing.  the installed version
of the package omits that file and thus does
not open the internals to all clients.

R=r
OCL=33065
CL=33097
2009-08-12 13:18:37 -07:00
Russ Cox
0496040bd6 remove unnecessary pkg. references
R=r
DELTA=95  (0 added, 0 deleted, 95 changed)
OCL=33012
CL=33012
2009-08-10 22:02:51 -07:00
Robert Griesemer
a288095813 - FieldByName lookup through anonymous fields
- FieldByIndex
- changed StructField.Index type from int -> []int
- adjustments to reflect clients

R=rsc,r
DELTA=336  (263 added, 47 deleted, 26 changed)
OCL=32731
CL=32802
2009-08-05 15:56:44 -07:00
Rob Pike
cb9c973829 don't crash printing a nil map
R=rsc
DELTA=19  (18 added, 0 deleted, 1 changed)
OCL=32656
CL=32670
2009-08-03 13:34:20 -07:00
Russ Cox
123ff2ebb8 bug177: anonymous struct fields in reflect
(reported by iant)

R=r
DELTA=50  (32 added, 12 deleted, 6 changed)
OCL=32263
CL=32385
2009-07-28 17:01:46 -07:00
Russ Cox
ca01716934 fix build - broke with uint32 -> int change in reflect SliceHeader
TBR=r
OCL=32225
CL=32225
2009-07-27 11:23:49 -07:00
Russ Cox
22ea3f9e49 fix SliceHeader: len and cap are int, not uint32
R=r,iant
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=32215
CL=32222
2009-07-27 10:59:37 -07:00
Ian Lance Taylor
f0c00f7eee Don't cast nil to a fixed array type.
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31916
CL=31937
2009-07-21 14:06:14 -07:00
Ian Lance Taylor
39808db15a Make struct field names unique.
R=rsc
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=31900
CL=31900
2009-07-20 23:26:03 -07:00
Rob Pike
ba0cf083a2 change reflect.Type.Name() into two functions: Name() and PkgPath() for ease of use.
R=rsc
DELTA=31  (8 added, 2 deleted, 21 changed)
OCL=31778
CL=31792
2009-07-17 14:20:33 -07:00
Rob Pike
a93c5c8550 add FieldByName to the interface of reflect.StructType
R=rsc
DELTA=34  (33 added, 0 deleted, 1 changed)
OCL=31752
CL=31754
2009-07-16 18:21:14 -07:00
Rob Pike
b75df2f695 fix some bad testing prints
R=rsc
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=31740
CL=31742
2009-07-16 15:01:21 -07:00
Russ Cox
92e925778e reflection for interface set
rename map access methods to Elem, SetElem.

R=r
DELTA=95  (66 added, 7 deleted, 22 changed)
OCL=31456
CL=31469
2009-07-10 16:32:26 -07:00
Rob Pike
1880b90aff DeepEqual for maps
R=rsc
DELTA=47  (30 added, 16 deleted, 1 changed)
OCL=31455
CL=31455
2009-07-10 11:20:10 -07:00
Russ Cox
12ebbe7463 reflection for methods
R=r
DELTA=156  (135 added, 8 deleted, 13 changed)
OCL=31407
CL=31428
2009-07-09 17:27:49 -07:00
Russ Cox
bba278a43b reflection for functions
add channel send type check (thanks austin).
fix type mismatch message.

R=r
DELTA=241  (225 added, 5 deleted, 11 changed)
OCL=31370
CL=31375
2009-07-08 18:16:09 -07:00
Russ Cox
5ddaf9a098 reflection for channels
R=r
DELTA=188  (171 added, 6 deleted, 11 changed)
OCL=31352
CL=31361
2009-07-08 15:00:54 -07:00
Russ Cox
764b6ec1aa reflection for maps
R=r
DELTA=304  (248 added, 34 deleted, 22 changed)
OCL=31345
CL=31347
2009-07-08 13:55:57 -07:00
Ian Lance Taylor
dbc6d91d70 typestring.c is no longer needed.
R=rsc
DELTA=35  (0 added, 34 deleted, 1 changed)
OCL=31301
CL=31303
2009-07-07 14:50:39 -07:00
Russ Cox
64f4e0b197 update reflect supporting functions,
tests to use new reflect interface.

also make tests a real gotest.

depends on CL 31107

R=r
DELTA=582  (56 added, 194 deleted, 332 changed)
OCL=31108
CL=31279
2009-07-07 11:03:12 -07:00
Russ Cox
ce2e450c6b install new reflect:
rename ntype.go and nvalue.go to type.go and value.go

R=r
DELTA=4295  (761 added, 2819 deleted, 715 changed)
OCL=31238
CL=31276
2009-07-07 11:02:44 -07:00
Russ Cox
58c4142e74 new reflect Value implementations.
for now, canSet stays.
i will look into getting rid of it in
a future CL.

R=r
DELTA=420  (419 added, 0 deleted, 1 changed)
OCL=31231
CL=31235
2009-07-06 22:10:40 -07:00
Russ Cox
a7b4e9f03e new reflect type.go implementation
R=r
DELTA=179  (172 added, 6 deleted, 1 changed)
OCL=31215
CL=31220
2009-07-06 16:06:31 -07:00
Russ Cox
4793400bd1 new reflect library data structures and code declarations
* use structs instead of interfaces
  * compiler lays out data structures ahead of time,
    so no more parsing of strings.
  * unified reflect data structures with interface
    runtime data structures.
  * richer data structures should enable reflection
    on chans and maps, but not implemented here.

R=r,iant
DELTA=1179  (1179 added, 0 deleted, 0 changed)
OCL=31107
CL=31213
2009-07-06 15:34:04 -07:00
Rob Pike
29e6eb21ec make a description of the slice header public
R=rsc
DELTA=18  (3 added, 0 deleted, 15 changed)
OCL=31086
CL=31094
2009-07-02 16:28:04 -07:00
Russ Cox
a439f66228 add test, fix bug: structs that differ in their
first field were not being handled correctly
because the visited map did not include the type.

R=r
OCL=31006
CL=31006
2009-07-01 16:45:09 -07:00
Russ Cox
ae11e9eb88 fix build
TBR=r
OCL=30757
CL=30757
2009-06-25 15:15:44 -07:00
Russ Cox
4866223c2e add reflect.Typeof; test for and fix nil interface bug in DeepEqual
R=r
DELTA=40  (30 added, 2 deleted, 8 changed)
OCL=30742
CL=30753
2009-06-25 14:25:38 -07:00
Russ Cox
a50cbf6c73 style police: parens in if, for, switch, range
R=r
DELTA=32  (0 added, 3 deleted, 29 changed)
OCL=30718
CL=30725
2009-06-24 20:12:50 -07:00
David Symonds
d4e57ff248 Fix a proto encoding crasher whereby a nil in a repeated group field would crash the server.
Also fix the reflect bug that was exposed by this bug.

R=r
APPROVED=rsc
DELTA=162  (103 added, 32 deleted, 27 changed)
OCL=30125
CL=30319
2009-06-15 18:35:04 -07:00
Rob Pike
d90e7cbac6 mv src/lib to src/pkg
tests: all.bash passes, gobuild still works, godoc still works.

R=rsc
OCL=30096
CL=30102
2009-06-09 09:53:44 -07:00