package main import ( "go/types" "fmt" ) func main() { pkg := types.NewPackage("mypackage", "mypackage") foo := types.NewFunc(0, pkg, "foo", types.NewSignature(nil, nil, nil, false)) fmt.Println(foo.Type()) }
package main import ( "go/types" "fmt" ) func main() { pkg := types.NewPackage("mypackage", "mypackage") iface := types.NewInterface(nil, nil) fmt.Println(iface.IsInterface()) }Package library: golang.org/x/tools/go/types.