Conversation
|
@dnephin need to change the swagger generator? |
|
ping @moby/moby-maintainers |
|
It's really verbose to include it in every So, TLDR; +1! |
|
Looks like the files generated by swagger need to be updated; |
|
Oh, never mind, I see @tiborvass already commented that 😊 |
|
We should not modify pb.go files |
|
@dnephin I wonder if we really need to add the canonical import path on all files, or whether we could simply put it in the files at the root. Wouldn't that solve the issue of go-getting two copies? |
|
I don't think so. I think if you were to import any package outside the root you'd run into the same problem. I'm not sure if it needs to be in every file, or "at least one file per package", but it seems like it's more obvious if it's in every file. I'll test some things to confirm. |
1816082 to
6acf52b
Compare
|
Ok, I've reverted the change on generated files (swagger and I looked at modifying the swagger-gen templates, the problem is getting the relative directory name to use in the canonical import path. |
Signed-off-by: Daniel Nephin <dnephin@docker.com>
6acf52b to
4f0d95f
Compare
|
This is green |
|
LGTM 👍 |
|
Can we add a validation step in CI that checks if new files that were added have the canonical path set? |
|
yes, I'll look at adding that. |
Internally all packages are imported as
github.com/docker/docker, so the package statement should document this by using canonical import paths.go buildwill report an error when a package is used from a path that doesn't match the canonical path.