soheilhy / cmux

Connection multiplexer for GoLang: serve different services on the same port!
Apache License 2.0
2.53k stars 197 forks source link

Possibly move examples_test.go to examples package #70

Open antongocode opened 4 years ago

antongocode commented 4 years ago

Apologies for this, but due to weirdness of go modules, see here https://github.com/golang/go/issues/29323, when vendoring cmux as a dependency it also vendors google.golang.org/grpc purely because it is a test dependency.

Would you perhaps consider moving the example test to its own package?

VoyTechnology commented 3 years ago

This is still an issue, but this time with grpc/examples.

My editor complains about missing dependency:

google.golang.org/grpc/examples is not in your go.mod file

This is what happens when go mod tidy is ran:

go.mod

require (
    // ...
    github.com/soheilhy/cmux v0.1.4
    google.golang.org/grpc/examples v0.0.0-20210208035533-9280052d3665 // indirect
)
$ go mod why google.golang.org/grpc/examples/helloworld/helloworld
# google.golang.org/grpc/examples/helloworld/helloworld
<REDACTED PACKAGE NAME>
github.com/soheilhy/cmux
github.com/soheilhy/cmux.test
google.golang.org/grpc/examples/helloworld/helloworld