utrack / clay

Proto-first minimal server platform for gRPС+REST+Swagger APIs
MIT License
290 stars 37 forks source link

Close notifier fix #74

Closed makhov closed 4 years ago

makhov commented 4 years ago

Build tag added to fix the error:

# github.com/utrack/clay/v2/server/middlewares/mwhttp
../../go/pkg/mod/github.com/utrack/clay/v2@v2.4.1/server/middlewares/mwhttp/closenotifier.go:7:9: undefined: middleware.CloseNotify
makhov commented 4 years ago

No, we use go1.13 and we get the error, because middleware.CloseNotify was removed from chi. Please, notice that the build tag contains !go1.9. This means it won't be compiled from v1.9 and above.

utrack commented 4 years ago

Thank you for your contribution!

I don't think that fixes the problem properly. It seems like chi/mw.CloseNotify was removed in some recent version of chi, but currently clay uses an old version that still has it in code.

Since CloseNotifier is deprecated - I think it'd be a good idea to remove that middleware entirely (esp when current PR already does it for post-1.8 builds and leaves pre-1.9 broken when a recent version of chi is vendored).

Can you please remove the CloseNotifier from code entirely?

makhov commented 4 years ago

Done!

makhov commented 4 years ago

Thanks for merging! Could you create a new tag, please, to make it work with Go modules?

utrack commented 4 years ago

Sure - tagged v2.4.2.