Skip to content

Commit

Permalink
Merge pull request #1909 from xushiwei/q
Browse files Browse the repository at this point in the history
llgo: reflect
  • Loading branch information
xushiwei authored Jul 1, 2024
2 parents 3df6bf3 + 2857b90 commit 847df09
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions testdata/_llgo/reflect/reflect.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import (
"c"
"reflect"
)

tyIntSlice := reflect.sliceOf(reflect.typeOf(0))
v := reflect.zero(tyIntSlice)
v = reflect.append(v, reflect.valueOf(1), reflect.valueOf(2), reflect.valueOf(3))
for i, n := 0, v.len; i < n; i++ {
item := v.index(i)
c.Printf c"%d\n", item.int
}

0 comments on commit 847df09

Please sign in to comment.