Skip to content

Commit

Permalink
Merge pull request vektra#93 from IvanMalison/handle_vendor_imports
Browse files Browse the repository at this point in the history
Refactor import generation to be much more robust
  • Loading branch information
evanphx authored Oct 3, 2016
2 parents 50e94cc + 85d7013 commit bc0273f
Show file tree
Hide file tree
Showing 11 changed files with 714 additions and 486 deletions.
3 changes: 3 additions & 0 deletions mockery/fixtures/http/http.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package http

type MyStruct struct{}
10 changes: 10 additions & 0 deletions mockery/fixtures/imports_from_nested_interface.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package test

import (
"github.com/vektra/mockery/mockery/fixtures/http"
)

type HasConflictingNestedImports interface {
RequesterNS
Z() http.MyStruct
}
13 changes: 13 additions & 0 deletions mockery/fixtures/imports_same_as_package.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package test

import (
"github.com/vektra/mockery/mockery/fixtures/test"
)

type C int

type ImportsSameAsPackage interface {
A() test.B
B() KeyManager
C(C)
}
13 changes: 13 additions & 0 deletions mockery/fixtures/same_name_imports.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package test

import (
"net/http"

my_http "github.com/vektra/mockery/mockery/fixtures/http"
)

// Example is an example
type Example interface {
A() http.Flusher
B(fixtureshttp string) my_http.MyStruct
}
3 changes: 3 additions & 0 deletions mockery/fixtures/test/test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package test

type B int
3 changes: 3 additions & 0 deletions mockery/fixtures/twopackages/one.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package twopackages

type InMainPackage interface{}
7 changes: 7 additions & 0 deletions mockery/fixtures/twopackages/one_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package twopackages_test

import "net/http"

type InterfaceInTestPackage interface {
A() http.File
}
Loading

0 comments on commit bc0273f

Please sign in to comment.