mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 20:43:40 +00:00
extend stdlib to allow import of more packages (#1099)
* stdlib: extend stdlib to allow import of more packages
This commit is contained in:
Vendored
+14
@@ -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"))
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -336,3 +336,6 @@ float64 8 64
|
||||
complex64 8 64
|
||||
complex128 16 128
|
||||
type assertion succeeded for unreferenced type
|
||||
|
||||
struct tags
|
||||
blue gopher
|
||||
|
||||
Reference in New Issue
Block a user