File tree Expand file tree Collapse file tree 6 files changed +62
-1
lines changed
compliance/tests/reflect_struct_field Expand file tree Collapse file tree 6 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 1+ StructField Name: TestField
2+ StructField Type: string
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "reflect"
4+
5+ func main () {
6+ // Test creating a StructField value
7+ field := reflect.StructField {
8+ Name : "TestField" ,
9+ Type : reflect .TypeOf ("" ),
10+ }
11+ println ("StructField Name:" , field .Name )
12+ println ("StructField Type:" , field .Type .String ())
13+ }
Original file line number Diff line number Diff line change 1+ // Generated file based on reflect_struct_field.go
2+ // Updated when compliance tests are re-run, DO NOT EDIT!
3+
4+ import * as $ from "@goscript/builtin/index.js"
5+
6+ import * as reflect from "@goscript/reflect/index.js"
7+
8+ export async function main ( ) : Promise < void > {
9+ // Test creating a StructField value
10+ let field = $ . markAsStructValue ( new reflect . StructField ( { Name : "TestField" , Type : reflect . TypeOf ( "" ) } ) )
11+ console . log ( "StructField Name:" , field . Name )
12+ console . log ( "StructField Type:" , field . Type ! . String ( ) )
13+ }
14+
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "allowImportingTsExtensions" : true ,
4+ "lib" : [
5+ " es2022" ,
6+ " esnext.disposable" ,
7+ " dom"
8+ ],
9+ "module" : " nodenext" ,
10+ "moduleResolution" : " nodenext" ,
11+ "noEmit" : true ,
12+ "paths" : {
13+ "*" : [
14+ " ./*"
15+ ],
16+ "@goscript/*" : [
17+ " ../../../gs/*" ,
18+ " ../../../compliance/deps/*"
19+ ],
20+ "@goscript/github.com/aperturerobotics/goscript/compliance/tests/reflect_struct_field/*" : [
21+ " ./*"
22+ ]
23+ },
24+ "sourceMap" : true ,
25+ "target" : " es2022"
26+ },
27+ "extends" : " ../../../tsconfig.json" ,
28+ "include" : [
29+ " index.ts" ,
30+ " reflect_struct_field.gs.ts"
31+ ]
32+ }
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export { Swapper } from './swapper.js'
3535// Export new types and constants
3636export {
3737 StructTag ,
38+ StructField ,
3839 ValueError ,
3940 SelectDir ,
4041 SelectSend ,
@@ -45,7 +46,6 @@ export {
4546export type {
4647 uintptr ,
4748 Pointer ,
48- StructField ,
4949 Method ,
5050 SelectCase ,
5151 SliceHeader ,
You can’t perform that action at this time.
0 commit comments