Skip to content

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

@michilu

Description

@michilu

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 .

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions