Skip to content
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

Duplicate /v2 applied on some files #10

Closed
johanbrandhorst opened this issue Apr 18, 2020 · 2 comments
Closed

Duplicate /v2 applied on some files #10

johanbrandhorst opened this issue Apr 18, 2020 · 2 comments

Comments

@johanbrandhorst
Copy link

Hi!

I tried running mod on the grpc-gateway project and it produced some strange imports on some of the files:

examples/internal/server/echo.go:

package server

import (
	"context"

	"github.com/golang/glog"
	examples "github.com/grpc-ecosystem/grpc-gateway/v2/v2/examples/internal/proto/examplepb"
	"google.golang.org/grpc"
	"google.golang.org/grpc/metadata"
)

This happened to a few of them, but we also got some even more interesting imports:
runtime/errors.go:

package runtime

import (
	"context"
	"io"
	"net/http"

	"github.com/grpc-ecosystem/grpc-gateway/v2/v2/v2/internal"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/grpclog"
	"google.golang.org/grpc/status"
)

Steps to reproduce:

  1. Check out master of grpc-gateway:
    $ git clone git@github.com:grpc-ecosystem/grpc-gateway.git
  2. Run mod upgrade
    $ mod upgrade
@marwan-at-work
Copy link
Owner

marwan-at-work commented Apr 18, 2020

@johanbrandhorst hey 👋

Thanks for the catch :)

I just fixed this here and it seems to remove the issue.

Would love it if you can give it a try and let me know if it's working on your side.

More context: it looks like the ./... pattern for go/packages is loading multiple packages twice here, which is probably worth raising upstream. For now, I just ensured we don't process the same package or file twice.

@johanbrandhorst
Copy link
Author

@marwan-at-work hey 👋 😍!

That seems to have fixed it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants