2008-10-15 18:11:51 -06:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"reflect"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2008-10-16 12:19:48 -06:00
|
|
|
var s string;
|
2008-10-16 17:38:33 -06:00
|
|
|
var t reflect.Type;
|
|
|
|
|
|
|
|
t = reflect.ParseTypeString("int8");
|
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
|
|
|
|
|
|
|
t = reflect.ParseTypeString("**int8");
|
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
|
|
|
|
|
|
|
t = reflect.ParseTypeString("**P.integer");
|
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
|
|
|
|
|
|
|
t = reflect.ParseTypeString("[32]int32");
|
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
|
|
|
|
|
|
|
t = reflect.ParseTypeString("[]int8");
|
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
|
|
|
|
|
|
|
t = reflect.ParseTypeString("map[string]int32");
|
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
2008-10-16 19:09:38 -06:00
|
|
|
|
|
|
|
t = reflect.ParseTypeString("*chan<-string");
|
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
|
|
|
|
|
|
|
t = reflect.ParseTypeString("struct {c *chan *int32; d float32}");
|
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
|
|
|
|
|
|
|
t = reflect.ParseTypeString("*(a int8, b int32)");
|
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
|
|
|
|
2008-10-17 11:58:34 -06:00
|
|
|
t = reflect.ParseTypeString("struct {c *(? *chan *P.integer, ? *int8)}");
|
2008-10-16 19:09:38 -06:00
|
|
|
s = reflect.ToString(t); print(s, "\n");
|
2008-10-15 18:11:51 -06:00
|
|
|
}
|