summaryrefslogtreecommitdiff
path: root/vendor/github.com/golang/mock/mockgen/tests/custom_package_name/README.md
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-07-24 14:35:44 +0200
committerDimitri Sokolyuk <demon@dim13.org>2018-07-24 14:35:44 +0200
commit621e49bb465f500cc46d47e39e828cf76d6381d7 (patch)
treee9d6ed54cfae73209f2b0d9a016ef0b64adf45a6 /vendor/github.com/golang/mock/mockgen/tests/custom_package_name/README.md
parent5b9a4a158b81aa6e94a5a56d0851bea938b87bef (diff)
update vendor
Diffstat (limited to 'vendor/github.com/golang/mock/mockgen/tests/custom_package_name/README.md')
-rw-r--r--vendor/github.com/golang/mock/mockgen/tests/custom_package_name/README.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/golang/mock/mockgen/tests/custom_package_name/README.md b/vendor/github.com/golang/mock/mockgen/tests/custom_package_name/README.md
new file mode 100644
index 0000000..b16da21
--- /dev/null
+++ b/vendor/github.com/golang/mock/mockgen/tests/custom_package_name/README.md
@@ -0,0 +1,22 @@
+# Tests for custom package names
+
+This directory contains test for mockgen generating mocks when imported package
+name does not match import path suffix. For example, package with name "client"
+is located under import path "github.com/golang/mock/mockgen/tests/custom_package_name/client/v1".
+
+Prior to this patch:
+
+ $ go generate greeter/greeter.go
+ 2018/03/05 22:44:52 Loading input failed: greeter.go:17:11: failed parsing returns: greeter.go:17:14: unknown package "client"
+ greeter/greeter.go:1: running "mockgen": exit status 1
+
+This can be fixed by manually providing `-imports` flag, like `-imports client=github.com/golang/mock/mockgen/tests/custom_package_name/client/v1`.
+But, mockgen should be able to automatically resolve package names in such situations.
+
+With this patch applied:
+
+ $ go generate greeter/greeter.go
+ $ echo $?
+ 0
+
+Mockgen runs successfully, produced output is equal to [greeter_mock_test.go](greeter/greeter_mock_test.go) content.