github.com/goplus/gop@v1.2.6/testdata/typeasparamsmethod/col.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"reflect"
     6  )
     7  
     8  type basetype interface {
     9  	int | string
    10  }
    11  
    12  type Table struct {
    13  }
    14  
    15  func Gopt_Table_Gopx_Col__0[T basetype](p *Table, name string) {
    16  	fmt.Printf("Gopt_Table_Gopx_Col__0 %v: %s\n", reflect.TypeOf((*T)(nil)).Elem(), name)
    17  }
    18  
    19  func Gopt_Table_Gopx_Col__1[Array any](p *Table, name string) {
    20  	fmt.Printf("Gopt_Table_Gopx_Col__1 %v: %s\n", reflect.TypeOf((*Array)(nil)).Elem(), name)
    21  }