Enhance pluginrpc-gen parser

Now handles `package.Type` and `*package.Type`
Fixes parsing issues with slice and map types.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2016-04-09 17:42:24 -04:00
parent 054469e284
commit f636807065
7 changed files with 239 additions and 29 deletions

View file

@ -1,5 +1,17 @@
package foo
import (
"fmt"
aliasedio "io"
"github.com/docker/docker/pkg/plugins/pluginrpc-gen/fixtures/otherfixture"
)
var (
errFakeImport = fmt.Errorf("just to import fmt for imports tests")
)
type wobble struct {
Some string
Val string
@ -22,6 +34,7 @@ type Fooer3 interface {
Qux(a, b string) (val string, err error)
Wobble() (w *wobble)
Wiggle() (w wobble)
WiggleWobble(a []*wobble, b []wobble, c map[string]*wobble, d map[*wobble]wobble, e map[string][]wobble, f []*otherfixture.Spaceship) (g map[*wobble]wobble, h [][]*wobble, i otherfixture.Spaceship, j *otherfixture.Spaceship, k map[*otherfixture.Spaceship]otherfixture.Spaceship, l []otherfixture.Spaceship)
}
// Fooer4 is an interface used for tests.
@ -39,3 +52,38 @@ type Fooer5 interface {
Foo()
Bar
}
// Fooer6 is an interface used for tests.
type Fooer6 interface {
Foo(a otherfixture.Spaceship)
}
// Fooer7 is an interface used for tests.
type Fooer7 interface {
Foo(a *otherfixture.Spaceship)
}
// Fooer8 is an interface used for tests.
type Fooer8 interface {
Foo(a map[string]otherfixture.Spaceship)
}
// Fooer9 is an interface used for tests.
type Fooer9 interface {
Foo(a map[string]*otherfixture.Spaceship)
}
// Fooer10 is an interface used for tests.
type Fooer10 interface {
Foo(a []otherfixture.Spaceship)
}
// Fooer11 is an interface used for tests.
type Fooer11 interface {
Foo(a []*otherfixture.Spaceship)
}
// Fooer12 is an interface used for tests.
type Fooer12 interface {
Foo(a aliasedio.Reader)
}