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
Support non-top level imports #14
Comments
With the current approach, you must install an entire library before you can use subpackages. I can think of 4 ways to add this type of support:
This isn't really an issue with YARPC or ThriftRW since we want you installing the root package in order to use the library. Is that different with Zap or UberFX? Trying to think of what type of libraries want you to start from a subpackage only. Perhaps item 1 is sufficient in that case. |
I think the solution is much simpler than that, we just need to return the same page for all URLs under the root package. The only difference should be the godoc page we direct to. E.g., for grpc, the root:
For a subpackage that exists:
And a subpackage that does not exist:
Note how the |
@prashantv nice, except that Sally is a static site generator. It might be that item 3 is the only way - let me research a bit. Worse case I just rework sally and get go.uber.org on AWS - shouldn't be too big a deal. |
OK - I've reworked Sally into an HTTP server in #15 This makes Sally behave the same as google.golang.org/grpc. Non-existent package:
Existent package:
With trailing slash (#9):
With deep path:
With really deep path:
|
I think the HTTP server is the only way to fix the issue correctly. However, the barrier to using sally goes up significantly with this approach. Is option #2 something we could still support? E.g., when you run sally, it figured out the subpackages and adds them automatically. Re-running is all that's needed if there's a new package. |
@prashantv I had thought the same thing, but switching to a server was easy: #15 I think it's important we get Sally working seamlessly - I don't want a bunch of customers stumbling over confusing go tool errors, even if the current setup does work. I'm going to spend a bit of time today on a Travis -> AWS continuous deployment flow using go.graysonkoonce.com - if that ends up being easy, then I think this is a viable path. |
@breerly Switching to a HTTP server is easy in Go, but it's also harder for more users to use since the overhead goes from: "Use this tool + GitHub pages" to "Use this tool, and run it on some hosting service" (which now means yet another service to deploy, monitor, pay for hosting, etc). It really depends on the reach we'd like for sally. For my personal projects, I'd likely not use sally if it required hosting another binary somewhere, but would definitely consider it if it was super easy with GitHub pages. What do you think? |
@prashantv I think what I'd like to do is support both modes. For go.uber.org, I want it to be completely seamless, and so I'm ok hooking it up as a server. I think we should make it work as a static site generator for Github Pages at the same time. In that mode, the best we can likely do is dynamically determine the import paths and create the right static site structure from there. |
Yep, that'd be ideal, exactly what I was thinking :) |
Ok cool, sounds like we're set to move uberfx to go.uber.org/fx then? |
I have a very simply dummy program,
I have this in a completely clean GOPATH, and I run
go get .
, which should download all imports. This fails with:This works fine for non-vanity imports.
The text was updated successfully, but these errors were encountered: