extend stdlib to allow import of more packages (#1099)

* stdlib: extend stdlib to allow import of more packages
This commit is contained in:
Cornel
2020-06-23 12:56:28 +03:00
committed by GitHub
parent de45da5df4
commit 720a54a0fe
16 changed files with 549 additions and 13 deletions
+14
View File
@@ -264,6 +264,9 @@ func main() {
default:
println("type assertion failed (but should succeed)")
}
println("\nstruct tags")
TestStructTag()
}
func emptyFunc() {
@@ -352,3 +355,14 @@ func assertSize(ok bool, typ string) {
}
type unreferencedType int
func TestStructTag() {
type S struct {
F string `species:"gopher" color:"blue"`
}
s := S{}
st := reflect.TypeOf(s)
field := st.Field(0)
println(field.Tag.Get("color"), field.Tag.Get("species"))
}
+3
View File
@@ -336,3 +336,6 @@ float64 8 64
complex64 8 64
complex128 16 128
type assertion succeeded for unreferenced type
struct tags
blue gopher