diff options
| author | Russ Cox <rsc@golang.org> | 2009-01-20 14:40:40 -0800 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-01-20 14:40:40 -0800 |
| commit | 839a68469b6f8bf40620a7977041e089bbd0eba3 (patch) | |
| tree | f8305b165ee5ff41e9ef2b0f76e26f7ab3ece269 /src/lib/reflect | |
| parent | 0183baaf449338f54727814d079c0254c18226f9 (diff) | |
| download | go-839a68469b6f8bf40620a7977041e089bbd0eba3.tar.xz | |
delete export
TBR=r
OCL=23121
CL=23127
Diffstat (limited to 'src/lib/reflect')
| -rw-r--r-- | src/lib/reflect/all_test.go | 12 | ||||
| -rw-r--r-- | src/lib/reflect/tostring.go | 8 | ||||
| -rw-r--r-- | src/lib/reflect/type.go | 30 | ||||
| -rw-r--r-- | src/lib/reflect/value.go | 62 |
4 files changed, 56 insertions, 56 deletions
diff --git a/src/lib/reflect/all_test.go b/src/lib/reflect/all_test.go index 4ad8abd74e..631a5662c4 100644 --- a/src/lib/reflect/all_test.go +++ b/src/lib/reflect/all_test.go @@ -87,9 +87,9 @@ func valuedump(s, t string) { assert(reflect.ValueToString(v), t); } -export type T struct { a int; b float64; c string; d *int } +type T struct { a int; b float64; c string; d *int } -export func TestAll(tt *testing.T) { // TODO(r): wrap up better +func TestAll(tt *testing.T) { // TODO(r): wrap up better var s string; var t reflect.Type; @@ -285,7 +285,7 @@ export func TestAll(tt *testing.T) { // TODO(r): wrap up better } } -export func TestInterfaceGet(t *testing.T) { +func TestInterfaceGet(t *testing.T) { var inter struct { e interface{ } }; inter.e = 123.456; v1 := reflect.NewValue(&inter); @@ -296,7 +296,7 @@ export func TestInterfaceGet(t *testing.T) { assert(v3.Type().String(), "float"); } -export func TestCopyArray(t *testing.T) { +func TestCopyArray(t *testing.T) { a := []int{ 1, 2, 3, 4, 10, 9, 8, 7 }; b := []int{ 11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44 }; c := []int{ 11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44 }; @@ -331,7 +331,7 @@ export func TestCopyArray(t *testing.T) { } } -export func TestBigUnnamedStruct(t *testing.T) { +func TestBigUnnamedStruct(t *testing.T) { b := struct{a,b,c,d int64}{1, 2, 3, 4}; v := NewValue(b); b1 := v.Interface().(struct{a,b,c,d int64}); @@ -343,7 +343,7 @@ export func TestBigUnnamedStruct(t *testing.T) { type big struct { a, b, c, d, e int64 } -export func TestBigStruct(t *testing.T) { +func TestBigStruct(t *testing.T) { b := big{1, 2, 3, 4, 5}; v := NewValue(b); b1 := v.Interface().(big); diff --git a/src/lib/reflect/tostring.go b/src/lib/reflect/tostring.go index d451e552fe..38d9d9135f 100644 --- a/src/lib/reflect/tostring.go +++ b/src/lib/reflect/tostring.go @@ -12,8 +12,8 @@ import ( "strconv"; ) -export func TypeToString(typ Type, expand bool) string -export func ValueToString(val Value) string +func TypeToString(typ Type, expand bool) string +func ValueToString(val Value) string func doubleQuote(s string) string { out := "\""; @@ -62,7 +62,7 @@ func typeFieldsToString(t hasFields, sep string) string { return str; } -export func TypeToString(typ Type, expand bool) string { +func TypeToString(typ Type, expand bool) string { var str string; if name := typ.Name(); !expand && name != "" { return name @@ -126,7 +126,7 @@ func integer(v int64) string { return strconv.Itoa64(v); } -export func ValueToString(val Value) string { +func ValueToString(val Value) string { var str string; typ := val.Type(); switch(val.Kind()) { diff --git a/src/lib/reflect/type.go b/src/lib/reflect/type.go index a7e8f7f317..1095ccb497 100644 --- a/src/lib/reflect/type.go +++ b/src/lib/reflect/type.go @@ -12,13 +12,13 @@ import ( "sync"; ) -export type Type interface +type Type interface -export func ExpandType(name string) Type +func ExpandType(name string) Type func typestrings() string // implemented in C; declared here -export const ( +const ( MissingKind = iota; ArrayKind; BoolKind; @@ -54,7 +54,7 @@ var interfacesize int var missingString = "$missing$" // syntactic name for undefined type names var dotDotDotString = "..." -export type Type interface { +type Type interface { Kind() int; Name() string; String() string; @@ -102,7 +102,7 @@ func newBasicType(name string, kind int, size int) Type { } // Prebuilt basic types -export var ( +var ( Missing = newBasicType(missingString, MissingKind, 1); DotDotDot = newBasicType(dotDotDotString, DotDotDotKind, 16); // TODO(r): size of interface? Bool = newBasicType("bool", BoolKind, 1); // TODO: need to know how big a bool is @@ -145,7 +145,7 @@ func (t *stubType) Get() Type { // -- Pointer -export type PtrType interface { +type PtrType interface { Sub() Type } @@ -164,7 +164,7 @@ func (t *ptrTypeStruct) Sub() Type { // -- Array -export type ArrayType interface { +type ArrayType interface { Open() bool; Len() int; Elem() Type; @@ -203,7 +203,7 @@ func (t *arrayTypeStruct) Elem() Type { // -- Map -export type MapType interface { +type MapType interface { Key() Type; Elem() Type; } @@ -228,12 +228,12 @@ func (t *mapTypeStruct) Elem() Type { // -- Chan -export type ChanType interface { +type ChanType interface { Dir() int; Elem() Type; } -export const ( // channel direction +const ( // channel direction SendDir = 1 << iota; RecvDir; BothDir = SendDir | RecvDir; @@ -259,7 +259,7 @@ func (t *chanTypeStruct) Elem() Type { // -- Struct -export type StructType interface { +type StructType interface { Field(int) (name string, typ Type, tag string, offset int); Len() int; } @@ -319,7 +319,7 @@ func (t *structTypeStruct) Len() int { // -- Interface -export type InterfaceType interface { +type InterfaceType interface { Field(int) (name string, typ Type, tag string, offset int); Len() int; } @@ -345,7 +345,7 @@ var nilInterface = newInterfaceTypeStruct("nil", "", make([]structField, 0)); // -- Func -export type FuncType interface { +type FuncType interface { In() StructType; Out() StructType; } @@ -842,7 +842,7 @@ func (p *typeParser) Type(name string) *stubType { return s; } -export func ParseTypeString(name, typestring string) Type { +func ParseTypeString(name, typestring string) Type { if typestring == "" { // If the typestring is empty, it represents (the type of) a nil interface value return nilInterface @@ -902,7 +902,7 @@ func typeNameToTypeString(name string) string { } // Type is known by name. Find (and create if necessary) its real type. -export func ExpandType(name string) Type { +func ExpandType(name string) Type { lock(); t, ok := types[name]; if ok { diff --git a/src/lib/reflect/value.go b/src/lib/reflect/value.go index ebd3c5f4ad..f1651a28c8 100644 --- a/src/lib/reflect/value.go +++ b/src/lib/reflect/value.go @@ -12,13 +12,13 @@ import ( "unsafe"; ) -export type Addr unsafe.pointer +type Addr unsafe.Pointer func equalType(a, b Type) bool { return a.String() == b.String() } -export type Value interface { +type Value interface { Kind() int; Type() Type; Addr() Addr; @@ -65,7 +65,7 @@ type creatorFn *(typ Type, addr Addr) Value // -- Missing -export type MissingValue interface { +type MissingValue interface { Kind() int; Type() Type; Addr() Addr; @@ -81,7 +81,7 @@ func missingCreator(typ Type, addr Addr) Value { // -- Int -export type IntValue interface { +type IntValue interface { Kind() int; Get() int; Set(int); @@ -106,7 +106,7 @@ func (v *intValueStruct) Set(i int) { // -- Int8 -export type Int8Value interface { +type Int8Value interface { Kind() int; Get() int8; Set(int8); @@ -131,7 +131,7 @@ func (v *int8ValueStruct) Set(i int8) { // -- Int16 -export type Int16Value interface { +type Int16Value interface { Kind() int; Get() int16; Set(int16); @@ -156,7 +156,7 @@ func (v *int16ValueStruct) Set(i int16) { // -- Int32 -export type Int32Value interface { +type Int32Value interface { Kind() int; Get() int32; Set(int32); @@ -181,7 +181,7 @@ func (v *int32ValueStruct) Set(i int32) { // -- Int64 -export type Int64Value interface { +type Int64Value interface { Kind() int; Get() int64; Set(int64); @@ -206,7 +206,7 @@ func (v *int64ValueStruct) Set(i int64) { // -- Uint -export type UintValue interface { +type UintValue interface { Kind() int; Get() uint; Set(uint); @@ -231,7 +231,7 @@ func (v *uintValueStruct) Set(i uint) { // -- Uint8 -export type Uint8Value interface { +type Uint8Value interface { Kind() int; Get() uint8; Set(uint8); @@ -256,7 +256,7 @@ func (v *uint8ValueStruct) Set(i uint8) { // -- Uint16 -export type Uint16Value interface { +type Uint16Value interface { Kind() int; Get() uint16; Set(uint16); @@ -281,7 +281,7 @@ func (v *uint16ValueStruct) Set(i uint16) { // -- Uint32 -export type Uint32Value interface { +type Uint32Value interface { Kind() int; Get() uint32; Set(uint32); @@ -306,7 +306,7 @@ func (v *uint32ValueStruct) Set(i uint32) { // -- Uint64 -export type Uint64Value interface { +type Uint64Value interface { Kind() int; Get() uint64; Set(uint64); @@ -331,7 +331,7 @@ func (v *uint64ValueStruct) Set(i uint64) { // -- Uintptr -export type UintptrValue interface { +type UintptrValue interface { Kind() int; Get() uintptr; Set(uintptr); @@ -356,7 +356,7 @@ func (v *uintptrValueStruct) Set(i uintptr) { // -- Float -export type FloatValue interface { +type FloatValue interface { Kind() int; Get() float; Set(float); @@ -381,7 +381,7 @@ func (v *floatValueStruct) Set(f float) { // -- Float32 -export type Float32Value interface { +type Float32Value interface { Kind() int; Get() float32; Set(float32); @@ -406,7 +406,7 @@ func (v *float32ValueStruct) Set(f float32) { // -- Float64 -export type Float64Value interface { +type Float64Value interface { Kind() int; Get() float64; Set(float64); @@ -431,7 +431,7 @@ func (v *float64ValueStruct) Set(f float64) { // -- Float80 -export type Float80Value interface { +type Float80Value interface { Kind() int; Get() float80; Set(float80); @@ -459,7 +459,7 @@ func (v *Float80ValueStruct) Set(f float80) { // -- String -export type StringValue interface { +type StringValue interface { Kind() int; Get() string; Set(string); @@ -484,7 +484,7 @@ func (v *stringValueStruct) Set(s string) { // -- Bool -export type BoolValue interface { +type BoolValue interface { Kind() int; Get() bool; Set(bool); @@ -509,7 +509,7 @@ func (v *boolValueStruct) Set(b bool) { // -- Pointer -export type PtrValue interface { +type PtrValue interface { Kind() int; Type() Type; Sub() Value; @@ -545,7 +545,7 @@ func ptrCreator(typ Type, addr Addr) Value { // -- Array -export type ArrayValue interface { +type ArrayValue interface { Kind() int; Type() Type; Open() bool; @@ -652,7 +652,7 @@ func arrayCreator(typ Type, addr Addr) Value { // -- Map TODO: finish and test -export type MapValue interface { +type MapValue interface { Kind() int; Type() Type; Len() int; @@ -678,7 +678,7 @@ func (v *mapValueStruct) Elem(key Value) Value { // -- Chan -export type ChanValue interface { +type ChanValue interface { Kind() int; Type() Type; } @@ -693,7 +693,7 @@ func chanCreator(typ Type, addr Addr) Value { // -- Struct -export type StructValue interface { +type StructValue interface { Kind() int; Type() Type; Len() int; @@ -728,7 +728,7 @@ func structCreator(typ Type, addr Addr) Value { // -- Interface -export type InterfaceValue interface { +type InterfaceValue interface { Kind() int; Type() Type; Get() interface {}; @@ -748,7 +748,7 @@ func interfaceCreator(typ Type, addr Addr) Value { // -- Func -export type FuncValue interface { +type FuncValue interface { Kind() int; Type() Type; } @@ -799,7 +799,7 @@ func newValueAddr(typ Type, addr Addr) Value { return c(typ, addr); } -export func NewInitValue(typ Type) Value { +func NewInitValue(typ Type) Value { // Some values cannot be made this way. switch typ.Kind() { case FuncKind: // must be pointers, at least for now (TODO?) @@ -825,7 +825,7 @@ export func NewInitValue(typ Type) Value { uint32 cap; // allocated number of elements }; */ -export func NewOpenArrayValue(typ ArrayType, len, cap int) ArrayValue { +func NewOpenArrayValue(typ ArrayType, len, cap int) ArrayValue { if !typ.Open() { return nil } @@ -843,7 +843,7 @@ export func NewOpenArrayValue(typ ArrayType, len, cap int) ArrayValue { return newValueAddr(typ, Addr(array)); } -export func CopyArray(dst ArrayValue, src ArrayValue, n int) { +func CopyArray(dst ArrayValue, src ArrayValue, n int) { if n == 0 { return } @@ -875,7 +875,7 @@ export func CopyArray(dst ArrayValue, src ArrayValue, n int) { } -export func NewValue(e interface {}) Value { +func NewValue(e interface {}) Value { value, typestring, indir := sys.Reflect(e); typ, ok := typecache[typestring]; if !ok { |
