fix: nil pointer

This commit is contained in:
2023-03-18 22:59:58 +08:00
parent 1f614fadb9
commit 875a73a463
4 changed files with 52 additions and 15 deletions

23
testdata/main.go vendored
View File

@@ -1,19 +1,26 @@
package goast
import (
_ "github.com/stretchr/testify"
)
import "gitter.top/coco/coco/core"
var a = 1
type ExampleService struct{}
const d = "world"
// IDE: ExampleService implemented main.ExampleServiceImpl interface
var _ main.ExampleServiceImpl = (*ExampleService)(nil)
func hello() {
// ExampleCall1 test rpc
func (receiver *ExampleService) ExampleCall1(ctx *core.Context, req *main.ExampleMessage1) (resp *main.ReturnType, err error) {
resp = new(main.ReturnType)
// TODO impl...
return resp, nil
}
type c int
// ExampleCall2
func (receiver *ExampleService) ExampleCall2(ctx *core.Context, req *main.ExampleMessage2) (resp *main.ReturnType, err error) {
resp = new(main.ReturnType)
func (cc c) name() {
// TODO impl...
return resp, nil
}