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

(interfacer) imports itself and has itself in prefix #12

Open
michilu opened this issue Sep 5, 2019 · 1 comment
Open

(interfacer) imports itself and has itself in prefix #12

michilu opened this issue Sep 5, 2019 · 1 comment

Comments

@michilu
Copy link

michilu commented Sep 5, 2019

Hi! Guys,

I had problems,

  1. imports itself
  • ex) import "github.com/michilu/example/example"
  1. prefix has itself
  • ex) *example.Two

example.go

package example

import "context"

//go:generate interfacer -for github.com/michilu/example/example.Zero -as example.ZeroIF -o ZeroIF.go

type Zero struct {
	One context.Context
	Two *Two
}

func (p *Zero) GetOne() context.Context {
	return p.One
}
func (p *Zero) GetTwo() *Two {
	return p.Two
}

type Two struct{}

then,

$ go generate ./...

generated ZeroIF.go:

// Created by interfacer; DO NOT EDIT

package example

import (
	"context"
	"github.com/michilu/example/example"
)

// ZeroIF is an interface generated for "github.com/michilu/example/example.Zero".
type ZeroIF interface {
	GetOne() context.Context
	GetTwo() *example.Two
}

The interfacer version is 60bd913 on Dec 21, 2018 .

@michilu michilu changed the title imports itself and has itself in prefix (interfacer) imports itself and has itself in prefix Sep 5, 2019
@rjeczalik
Copy link
Owner

Related #37 #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants