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

When method's response are other package struct slice, generated invalid interface. #13

Closed
Konboi opened this issue Oct 11, 2019 · 1 comment

Comments

@Konboi
Copy link
Contributor

Konboi commented Oct 11, 2019

I use interfacer and it's very useful but I happen this case.

I define struct like this

package foo

import (
   "github.com/example/hoge"
)

type Foo struct {}

func (f *Foo) Hoge1() error { return nil }

func (f *Foo) Hoge2() *hoge.Hoge { return &hoge.Hoge{} }

func (f *Foo) Hoge3() []*hoge.Hoge { return []*hoge.Hoge{...} }

I generate interface using by interfaces like this.

interfacer -for github.com/Konboi/foo.Foo  -as foo.Fooer -o foo.gen.go

but generated file is like this

package foo

import (
   "github.com/example/hoge"
)

type Fooer interface {
    Hoge1() error
    Hoge2() *hoge.Hoge
    Hoge3() []*github.com/example/hoge.Hoge
}

but I think it should be

package foo

import (
   "github.com/example/hoge"
)

type Fooer interface {
    Hoge1() error
    Hoge2() *hoge.Hoge
    Hoge3() []*hoge.Hoge
}

is it correct ??

please check it.

@Konboi Konboi changed the title When method's response are other package slice struct, generated invalid interface. When method's response are other package struct slice, generated invalid interface. Oct 11, 2019
@Konboi
Copy link
Contributor Author

Konboi commented Oct 15, 2019

fixed 🎉

@Konboi Konboi closed this as completed Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant