Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: goroutine stack exceeds 1000000000-byte limit #535

Open
wants to merge 147 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
de1c46f
add package_types for go1.11 index export format data
visualfc Jul 23, 2018
12854bb
add gomod parser
visualfc Jul 24, 2018
a53c135
update gomod search path
visualfc Jul 24, 2018
6374488
fix types_parser skip nil
visualfc Jul 24, 2018
53cf96f
add vendor
visualfc Jul 24, 2018
d82ff3e
fix gomod parser
visualfc Jul 24, 2018
4fb2223
update gomod vendor
visualfc Jul 24, 2018
ff80ac4
update dep
visualfc Jul 25, 2018
f276d6c
fix gomod for window
visualfc Jul 25, 2018
fac1dda
clean code
visualfc Jul 25, 2018
a2ba3a9
update gocode
visualfc Jul 26, 2018
12725f4
fix vendor parser
visualfc Jul 27, 2018
01e40e7
package_file_cache add vendor_name
visualfc Jul 27, 2018
df8d547
import github.com/visualfc/types to parser source
visualfc Jul 27, 2018
b9acfb2
pkgwalk parser
visualfc Jul 28, 2018
aa1aaae
fix lookup mod
visualfc Jul 28, 2018
a213f28
fix pkgwalk context
visualfc Aug 1, 2018
227f3aa
gocode, update mtime by pkgwalk
visualfc Aug 2, 2018
173b453
clean vendor
visualfc Aug 2, 2018
1cb0d2b
clean code
visualfc Aug 2, 2018
18c0e47
remove test
visualfc Aug 2, 2018
0ed1128
fix bug test.0055
visualfc Aug 2, 2018
25d21c2
update gomod dep
visualfc Aug 3, 2018
9138414
update dep
visualfc Aug 13, 2018
4367a5e
fix gomod search
visualfc Sep 1, 2018
e761f83
support syscall/js
visualfc Sep 2, 2018
0c4411d
add daemon name flag
visualfc Sep 2, 2018
08a66b5
change unix daemon name
visualfc Sep 2, 2018
62cb84c
fix gc_bin_parser unknownTag
visualfc Sep 21, 2018
79d9390
update gomod
visualfc Sep 26, 2018
2741456
update gomod cached
visualfc Sep 27, 2018
26b7158
update dep
visualfc Oct 3, 2018
dee5e96
update dep
visualfc Oct 5, 2018
d6d01da
types: use fastmod to parse large Go module project (gohugoio/hugo)
visualfc Oct 11, 2018
ccc0a05
fix fastmod empty lookup
visualfc Oct 13, 2018
49464a3
update fastmod&types for lookup module
visualfc Oct 19, 2018
a5206a1
x
visualfc Oct 19, 2018
b79a083
add typesinfo for liteide
visualfc Oct 23, 2018
5b33711
update daemon for liteide
visualfc Oct 23, 2018
3a9a658
types: fix and remove old runtime generate code
visualfc Oct 23, 2018
cdd8205
x
visualfc Oct 23, 2018
3cdd1dc
fix types source cache
visualfc Oct 24, 2018
ac884d8
fix multi var decl rip_off_decl bug
visualfc Nov 8, 2018
74d01a2
fix types info cache
visualfc Nov 8, 2018
ea43b6c
update types pkg check&update
visualfc Nov 10, 2018
52484cc
fix types mtime check
visualfc Nov 21, 2018
526da61
types: fix lookup named method embedded
visualfc Nov 22, 2018
331d2ec
x
visualfc Nov 22, 2018
693e160
fix local var check (test.0055)
visualfc Dec 21, 2018
7df5950
update vendor
visualfc Dec 23, 2018
28d2383
update imports list by source
visualfc Jan 25, 2019
80afea5
update vendor
visualfc Jan 25, 2019
c2c2a56
update imports intenal check
visualfc Jan 25, 2019
9227b5a
update vendor
visualfc Jan 25, 2019
3488632
imports check for mod
visualfc Jan 25, 2019
1d79edb
imports for mod add local path
visualfc Jan 26, 2019
3b52cc9
x
visualfc Jan 26, 2019
da45fb0
update imports filter
visualfc Jan 27, 2019
8a5616e
imports complete support parser mod sub pkg
visualfc Jan 27, 2019
e96ed7c
x
visualfc Jan 27, 2019
63ac8b5
imports skip goroot internal
visualfc Jan 27, 2019
c96df66
support types_info lookup in error code
visualfc Jan 30, 2019
4e0736b
fix mod
visualfc Jan 31, 2019
fab1738
force update source data
visualfc Mar 19, 2019
5b9ec49
update fastmod
visualfc Jul 13, 2019
c36d258
fix GOMOD check
visualfc Jul 14, 2019
23c031a
update go mod
visualfc Jul 14, 2019
5e8ed36
fix mod priority vendor check
visualfc Jul 15, 2019
1506461
fix gocode update_cache recover
visualfc Oct 6, 2019
0db6a6a
fastmod fix match full version, mypkg/v2
visualfc Jan 6, 2020
7557a6a
fix _,s1,s2 = ... bug, check new_decl_full func skip _
visualfc Jan 7, 2020
f7c4f43
update dep
visualfc Jan 7, 2020
672450d
fix ast.FuncDecl.Body.Rbrace bug in Go1.14
visualfc Mar 16, 2020
5fec8b8
fix testing/all.bash gocode path
visualfc Mar 16, 2020
02804b0
fix testing reflect for Go 1.13 1.14
visualfc Mar 16, 2020
f71a73f
add internal/gcexportdata internal/gcimporter,copy from golang.org/x/…
visualfc Apr 14, 2020
e8d6135
update depends
visualfc Apr 14, 2020
e566c19
fastmod v1.2.1
visualfc Apr 14, 2020
159fff9
fastmod v1.3.2
visualfc Apr 14, 2020
40ca1c8
fix cursor_in func block rbrace=0 on Go1.14
visualfc May 12, 2020
2e945ad
update fastmod v1.3.5
visualfc May 14, 2020
e7ac60d
fix find_child_and_in_embedded is_alias
visualfc May 17, 2020
a8c0af0
update fastmod v1.3.6
visualfc May 28, 2020
8cbede9
fix go build -mod=vendor
visualfc Oct 30, 2020
cfcb188
x
visualfc Feb 23, 2021
901895f
use github.com/visualfc/gomod for fix go.work
visualfc May 11, 2022
7e55e0f
unsafe: add .Add .Slice
visualfc May 11, 2022
28fbae5
update gotools, fix imports skip no goroot for GOMOD project
visualfc May 20, 2022
3d7cb2a
gotools v1.3.9, update dep import path
visualfc May 20, 2022
4777407
gotools v1.3.10
visualfc May 20, 2022
e3faf2f
fix typeparam for go118
visualfc Nov 29, 2022
e5a13fb
Merge pull request #1 from visualfc/imports
visualfc Nov 29, 2022
f3ba0c4
get_type_path support ast.IndexExpr/ast.IndexListExpr
visualfc Dec 26, 2022
e847e00
ast_decl_typeparams
visualfc Dec 26, 2022
c4a98f9
type_to_decl: check typeparams instance
visualfc Dec 27, 2022
6ba4928
deduce_cursor_context check token.RBRACK
visualfc Dec 28, 2022
8797c5a
lookup_types support lookup ident/instance
visualfc Dec 28, 2022
d6a66b8
token_items_to_string split two IDENT
visualfc Dec 28, 2022
b563def
token_iterator.extract_go_expr check struct
visualfc Dec 28, 2022
62f21e8
update _testing
visualfc Dec 28, 2022
be48c6c
inter_type: remove lookup_types
visualfc Dec 28, 2022
a857f63
type_to_decl: named child decl_func
visualfc Dec 28, 2022
ca5a6ba
infer_type check ast.CallExpr typeargs/typeparams
visualfc Dec 28, 2022
02d636c
types lookup scope by pkg
visualfc Dec 28, 2022
4996260
toObjectExpr: check current pkg
visualfc Dec 29, 2022
a0092c5
pkg import/export support named2Tags/func2Tag
visualfc Dec 30, 2022
9f84f72
pkg import/export support types.Interface embeddeds and types.Union
visualfc Dec 30, 2022
da7a59e
type_to_decl: check TypeParam
visualfc Dec 30, 2022
ec53e82
advance_type_to_decl
visualfc Dec 31, 2022
a1a8238
process_field_list_typeparams
visualfc Jan 1, 2023
fd1f096
apropos lookup ident
visualfc Jan 1, 2023
fdd7efa
Merge pull request #2 from visualfc/types
visualfc Jan 14, 2023
80ab3ed
gomod v0.1.2
visualfc Jan 14, 2023
54968b4
Merge pull request #3 from visualfc/gomod
visualfc Jan 14, 2023
bd4e5df
x
visualfc Jan 15, 2023
ed71ec8
Merge branch 'master' of https://github.com/visualfc/gocode
visualfc Jan 15, 2023
d48c660
unsafe for go1.16/go1.17/go1.20
visualfc Jan 15, 2023
fd17df0
workflows
visualfc Jan 15, 2023
396f1ac
Merge pull request #4 from visualfc/unsafe
visualfc Jan 15, 2023
7e10d8a
doc
visualfc Jan 15, 2023
28f3d1a
doc
visualfc Jan 15, 2023
12ce183
gotools v1.4.0
visualfc Jan 16, 2023
e40645f
Merge pull request #5 from visualfc/deps
visualfc Jan 16, 2023
e9187f5
fix type_to_decl types.Pointer
visualfc Jan 17, 2023
84bd5ce
type_to_decl: fix startexpr
visualfc Jan 17, 2023
097b080
Merge pull request #6 from visualfc/star
visualfc Jan 17, 2023
2dd9080
lookup_types_expr: check instance sig result
visualfc Jan 17, 2023
fd2e86c
lookup_types_instance_sig
visualfc Jan 17, 2023
ba7e230
pretty_print_type_expr check ast.IndexExpr/ast.IndexListExpr
visualfc Jan 17, 2023
a5ef30a
x
visualfc Jan 17, 2023
62c99a5
lookup_types_instance_sig: check struct field
visualfc Jan 17, 2023
829f910
lookup_types_text
visualfc Jan 17, 2023
c5af7e2
Merge pull request #7 from visualfc/decl
visualfc Jan 17, 2023
f17ebe6
infer_type: check funHasTypeArgs
visualfc Jan 17, 2023
f1dfe29
lookup_types_text skips
visualfc Jan 17, 2023
1087806
Merge pull request #8 from visualfc/typeargs
visualfc Jan 17, 2023
8ecbdaa
init source check and skip invalid pkg
visualfc Jan 18, 2023
ab85bc3
package: don't parser binary .a file
visualfc Jan 18, 2023
fc2e20c
Merge pull request #9 from visualfc/pkgerror
visualfc Jan 18, 2023
22e1999
type_to_decl: named has typeparams pass flags
visualfc Jan 19, 2023
97a7522
Merge pull request #10 from visualfc/type2
visualfc Jan 19, 2023
d7fe070
fix comparable type
visualfc Feb 7, 2023
ee4535d
Merge pull request #11 from visualfc/comparable
visualfc Feb 7, 2023
83d0ac7
update gotools
visualfc Feb 10, 2023
51e17aa
Merge pull request #12 from visualfc/dep
visualfc Feb 10, 2023
cc5b863
update dep
visualfc Feb 13, 2023
05ed0f4
Merge pull request #13 from visualfc/deps
visualfc Feb 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: gocode

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
Test:
strategy:
matrix:
go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x]
os: [ubuntu-latest, windows-latest, macos-11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Build
run: go build -v

32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
## An autocompletion daemon for the Go programming language
LiteIDE Gocode Tools
=========

### LiteIDE

_LiteIDE is a simple, open source, cross-platform Go IDE._

### Gocode
_Gocode is a golang code autocomplete support for LiteIDE._


- support Go1.11 Go modules.
- support Go1.18 generics.

```
go install github.com/visualfc/gocode@latest

Windows/Linux: copy GOPATH/bin gocode to liteide/bin
MacOS: copy GOPATH/bin gocode to LiteIDE.app/Contents/MacOS
```

### Website
* LiteIDE Source code
<https://github.com/visualfc/liteide>
* Gocode Source code
<https://github.com/visualfc/gocode>

**IMPORTANT: consider switching to https://github.com/mdempsky/gocode if you have problems starting with Go version 1.10, due to changes in binary packages architecture (introduction of package cache) I'm not going to adjust gocode for it for quite some time. There is a higher chance that fork under the given link will have some solution to the problem sooner or later.**

***

## An autocompletion daemon for the Go programming language

Gocode is a helper tool which is intended to be integrated with your source code editor, like vim, neovim and emacs. It provides several advanced capabilities, which currently includes:

Expand Down
6 changes: 4 additions & 2 deletions _testing/all.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env bash
gocode close
go build ../.
./gocode close
sleep 0.5
echo "--------------------------------------------------------------------"
echo "Autocompletion tests..."
echo "--------------------------------------------------------------------"
export XDG_CONFIG_HOME="$(mktemp -d)"
./run.rb
sleep 0.5
gocode close
./gocode close
rm ./gocode
3 changes: 2 additions & 1 deletion _testing/test.0008/out.expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Found 6 candidates:
Found 7 candidates:
func Lock()
func TryLock() bool
func Unlock()
var Mutex sync.Mutex
var data map[string][]string
Expand Down
3 changes: 2 additions & 1 deletion _testing/test.0009/out.expected
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Found 2 candidates:
Found 3 candidates:
func Lock()
func TryLock() bool
func Unlock()
15 changes: 13 additions & 2 deletions _testing/test.0011/out.expected
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
Found 59 candidates:
Found 70 candidates:
func Addr() reflect.Value
func Bool() bool
func Bytes() []byte
func Call(in []reflect.Value) []reflect.Value
func CallSlice(in []reflect.Value) []reflect.Value
func CanAddr() bool
func CanComplex() bool
func CanConvert(t reflect.Type) bool
func CanFloat() bool
func CanInt() bool
func CanInterface() bool
func CanSet() bool
func CanUint() bool
func Cap() int
func Close()
func Complex() complex128
func Convert(t reflect.Type) reflect.Value
func Elem() reflect.Value
func Field(i int) reflect.Value
func FieldByIndex(index []int) reflect.Value
func FieldByIndexErr(index []int) (reflect.Value, error)
func FieldByName(name string) reflect.Value
func FieldByNameFunc(match func(string) bool) reflect.Value
func Float() float64
Expand All @@ -23,10 +29,12 @@ Found 59 candidates:
func InterfaceData() [2]uintptr
func IsNil() bool
func IsValid() bool
func IsZero() bool
func Kind() reflect.Kind
func Len() int
func MapIndex(key reflect.Value) reflect.Value
func MapKeys() []reflect.Value
func MapRange() *reflect.MapIter
func Method(i int) reflect.Value
func MethodByName(name string) reflect.Value
func NumField() int
Expand All @@ -45,8 +53,10 @@ Found 59 candidates:
func SetComplex(x complex128)
func SetFloat(x float64)
func SetInt(x int64)
func SetIterKey(iter *reflect.MapIter)
func SetIterValue(iter *reflect.MapIter)
func SetLen(n int)
func SetMapIndex(key reflect.Value, val reflect.Value)
func SetMapIndex(key reflect.Value, elem reflect.Value)
func SetPointer(x unsafe.Pointer)
func SetString(x string)
func SetUint(x uint64)
Expand All @@ -58,3 +68,4 @@ Found 59 candidates:
func Type() reflect.Type
func Uint() uint64
func UnsafeAddr() uintptr
func UnsafePointer() unsafe.Pointer
3 changes: 2 additions & 1 deletion _testing/test.0020/out.expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Found 4 candidates:
Found 5 candidates:
func Lock()
func TryLock() bool
func Unlock()
var Dummy Dummy
var Mutex sync.Mutex
12 changes: 7 additions & 5 deletions _testing/test.0025/out.expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Found 4 candidates:
func Alignof(any) uintptr
func Offsetof(any) uintptr
func Sizeof(any) uintptr
type Pointer uintptr
Found 6 candidates:
func Add(ptr Pointer, len IntegerType) Pointer
func Alignof(x ArbitraryType) uintptr
func Offsetof(x ArbitraryType) uintptr
func Sizeof(x ArbitraryType) uintptr
func Slice(ptr *ArbitraryType, len IntegerType) []ArbitraryType
type Pointer *ArbitraryType
2 changes: 1 addition & 1 deletion _testing/test.0059/out.expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Found 1 candidates:
func NewReader(r io.Reader) io.Reader
func NewReader(r myio.Reader) myio.Reader
222 changes: 222 additions & 0 deletions ast.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
/*
Copyright 2021 The GoPlus Authors (goplus.org)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"go/ast"
"go/token"
"go/types"
"log"
"reflect"
"strconv"
)

var (
underscore = &ast.Ident{Name: "_"}
)

var (
identTrue = ident("true")
identFalse = ident("false")
identNil = ident("nil")
identAppend = ident("append")
identLen = ident("len")
identCap = ident("cap")
identNew = ident("new")
identMake = ident("make")
identIota = ident("iota")
)

func ident(name string) *ast.Ident {
return &ast.Ident{Name: name}
}

func boolean(v bool) *ast.Ident {
if v {
return identTrue
}
return identFalse
}

func toRecv(pkg *types.Package, recv *types.Var) *ast.FieldList {
if recv == nil {
return nil
}
var names []*ast.Ident
if name := recv.Name(); name != "" {
names = []*ast.Ident{ident(name)}
}
fld := &ast.Field{Names: names, Type: toType(pkg, recv.Type())}
return &ast.FieldList{List: []*ast.Field{fld}}
}

// -----------------------------------------------------------------------------
// function type

func toFieldList(pkg *types.Package, t *types.Tuple) []*ast.Field {
if t == nil {
return nil
}
n := t.Len()
flds := make([]*ast.Field, n)
for i := 0; i < n; i++ {
item := t.At(i)
var names []*ast.Ident
if name := item.Name(); name != "" {
names = []*ast.Ident{ident(name)}
}
typ := toType(pkg, item.Type())
flds[i] = &ast.Field{Names: names, Type: typ}
}
return flds
}

func toFields(pkg *types.Package, t *types.Struct) []*ast.Field {
n := t.NumFields()
flds := make([]*ast.Field, n)
for i := 0; i < n; i++ {
item := t.Field(i)
var names []*ast.Ident
if !item.Embedded() {
names = []*ast.Ident{{Name: item.Name()}}
}
typ := toType(pkg, item.Type())
fld := &ast.Field{Names: names, Type: typ}
if tag := t.Tag(i); tag != "" {
fld.Tag = &ast.BasicLit{Kind: token.STRING, Value: strconv.Quote(tag)}
}
flds[i] = fld
}
return flds
}

func toVariadic(fld *ast.Field) {
t, ok := fld.Type.(*ast.ArrayType)
if !ok || t.Len != nil {
panic("TODO: not a slice type")
}
fld.Type = &ast.Ellipsis{Elt: t.Elt}
}

// -----------------------------------------------------------------------------

func toType(pkg *types.Package, typ types.Type) ast.Expr {
switch t := typ.(type) {
case *types.Basic: // bool, int, etc
return toBasicType(pkg, t)
case *types.Pointer:
return &ast.StarExpr{X: toType(pkg, t.Elem())}
case *types.Named:
return toNamedType(pkg, t)
case *types.Interface:
return toInterface(pkg, t)
case *types.Slice:
return toSliceType(pkg, t)
case *types.Array:
return toArrayType(pkg, t)
case *types.Map:
return toMapType(pkg, t)
case *types.Struct:
return toStructType(pkg, t)
case *types.Chan:
return toChanType(pkg, t)
case *types.Signature:
return toFuncType(pkg, t)
case *TypeParam:
return toTypeParam(pkg, t)
}
log.Panicln("TODO: toType -", reflect.TypeOf(typ))
return nil
}

func toObjectExpr(pkg *types.Package, v types.Object) ast.Expr {
vpkg, name := v.Pkg(), v.Name()
if vpkg == nil || vpkg == g_daemon.autocomplete.typesPkg { // at universe or at this package
return ident(name)
}
return &ast.SelectorExpr{
X: ident(vpkg.Name()),
Sel: ident(name),
}
}

func toBasicType(pkg *types.Package, t *types.Basic) ast.Expr {
if t.Kind() == types.UnsafePointer {
return &ast.SelectorExpr{X: ast.NewIdent("unsafe"), Sel: ast.NewIdent("Pointer")}
}
if (t.Info() & types.IsUntyped) != 0 {
//panic("unexpected: untyped type")
}
return &ast.Ident{Name: t.Name()}
}

func isUntyped(pkg *types.Package, typ types.Type) bool {
switch t := typ.(type) {
case *types.Basic:
return (t.Info() & types.IsUntyped) != 0
}
return false
}

func toChanType(pkg *types.Package, t *types.Chan) ast.Expr {
return &ast.ChanType{Value: toType(pkg, t.Elem()), Dir: chanDirs[t.Dir()]}
}

var (
chanDirs = [...]ast.ChanDir{
types.SendRecv: ast.SEND | ast.RECV,
types.SendOnly: ast.SEND,
types.RecvOnly: ast.RECV,
}
)

func toStructType(pkg *types.Package, t *types.Struct) ast.Expr {
list := toFields(pkg, t)
return &ast.StructType{Fields: &ast.FieldList{List: list}}
}

func toArrayType(pkg *types.Package, t *types.Array) ast.Expr {
var len ast.Expr
if n := t.Len(); n < 0 {
len = &ast.Ellipsis{}
} else {
len = &ast.BasicLit{Kind: token.INT, Value: strconv.FormatInt(t.Len(), 10)}
}
return &ast.ArrayType{Len: len, Elt: toType(pkg, t.Elem())}
}

func toSliceType(pkg *types.Package, t *types.Slice) ast.Expr {
return &ast.ArrayType{Elt: toType(pkg, t.Elem())}
}

func toMapType(pkg *types.Package, t *types.Map) ast.Expr {
return &ast.MapType{Key: toType(pkg, t.Key()), Value: toType(pkg, t.Elem())}
}

func toInterface(pkg *types.Package, t *types.Interface) ast.Expr {
var flds []*ast.Field
for i, n := 0, t.NumEmbeddeds(); i < n; i++ {
typ := toType(pkg, t.EmbeddedType(i))
fld := &ast.Field{Type: typ}
flds = append(flds, fld)
}
for i, n := 0, t.NumExplicitMethods(); i < n; i++ {
fn := t.ExplicitMethod(i)
name := ident(fn.Name())
typ := toFuncType(pkg, fn.Type().(*types.Signature))
fld := &ast.Field{Names: []*ast.Ident{name}, Type: typ}
flds = append(flds, fld)
}
return &ast.InterfaceType{Methods: &ast.FieldList{List: flds}}
}
Loading