This isn't really Caddy's issue but rather oxy's, however the maintainer refused to merge the PR. Because of this, I have created a fork and changed the dependency.
More information can be found in the other issue, which also explains why this should be done: https://github.com/vulcand/oxy/issues/196.
The new dependency URL is https://github.com/diamondburned/oxy.
@diamondburned Thanks for bringing this up and for making a fork!
We could probably write a simpler circuit breaker that does not use the oxy/memmetrics pckage.
I am not sure the circuit breaker is commonly used by most people. (Edit: Ha! In fact, nobody can be using it! At a second glance, it doesn't work -- the OK() method that is required for the CircuitBreaker interface is called Ok() on ours, so it would have a runtime error. Thus, I am certain nobody is using it.)
Since it's apparently getting in the way of builds, there's still time for us to extract it into a separate repository. So we could keep the current circuit breaker in a separate repo until it is rewritten without that dependency. If people need it, they can plug it in just like any other modules, no problem. We could even adjust it right away to use your fork as well.
So, I propose:
What do you think?
I think that's the best idea.
@diamondburned I'm ready to push, but your fork's go.mod still declares itself as github.com/vulcand/oxy -- I am not 100% sure but I'm pretty sure all occurrences of "vulcand/oxy" needs to be replaced with "diamondburned/oxy", including the name in your go.mod. (Otherwise we have to use replace in downstream go.mod... I think.)
Could you do that, and then I'll push right away.
Oh, sorry. I'll do that right now.
That took me a while, I sedded the wrong one.
It is now pushed though: https://github.com/diamondburned/oxy/commit/e78a994a595fe88e838f58f73af29e43f4d88425. If you need a version, tell me.
@diamondburned Thanks! Almost there :)
Now I am getting this:
$ go mod tidy
go: finding module for package gopkg.in/ahmetb/go-linq.v3
go: found gopkg.in/ahmetb/go-linq.v3 in gopkg.in/ahmetb/go-linq.v3 v3.1.0
go: github.com/caddyserver/circuitbreaker imports
github.com/diamondburned/oxy/memmetrics imports
github.com/mailgun/holster tested by
github.com/mailgun/holster.test imports
gopkg.in/ahmetb/go-linq.v3: gopkg.in/ahmetb/[email protected]: parsing go.mod:
module declares its path as: github.com/ahmetb/go-linq/v3
but was required as: gopkg.in/ahmetb/go-linq.v3
I am not sure what caused this though.
My current go.mod is:
module github.com/caddyserver/circuitbreaker
go 1.14
require (
github.com/caddyserver/caddy/v2 v2.0.0-test.4
github.com/diamondburned/oxy v1.1.1-0.20200502015114-e78a994a595f
)
It looks like a module or import needs to be switched from gopkg.in/ahmetb/go-linq.v3 to github.com/ahmetb/go-linq/v3 or something like that. Any ideas?
Right, I actually get this issue as well, and it seems to be caused by yet another dependency. I'll probably have to fix it with yet another PR to a dependency.
However, this worked for me as a workaround. If you want, I can probably make a PR after a couple of minutes then update this issue.
The workaround:
replace gopkg.in/ahmetb/go-linq.v3 => github.com/ahmetb/go-linq/v3 v3.1.0
@diamondburned Ah, that works.
That's fine since that replace goes in the circuitbreaker module, not in this core caddy repo. It can be temporary anyway. Pushing...
Okay, great! I just pushed a507a5bbc72b70cba4e252b8ec7cbffdc09b4a86 which removes the module from this repo, and that code now lives at https://github.com/caddyserver/circuitbreaker using your fork.
Thanks for the help!
Something worth mentioning: I forgot to tidy up go.mod, so I did that just now. It would be great if you could update them on the new repo as well.
Done, thanks!