awslabs / aws-lambda-go-api-proxy

lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin (https://gin-gonic.github.io/gin/ ) to AWS Lambda and Amazon API Gateway.
Apache License 2.0
1.05k stars 197 forks source link

fix upgrade echo to v4 as per upstream instructions #50

Open wolfeidau opened 4 years ago

wolfeidau commented 4 years ago

https://github.com/labstack/echo#supported-go-versions

Issue #, if available:

Description of changes:

Upgrade echo to v4 as per upstream instructions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

sapessi commented 4 years ago

Were there any breaking changes between v4 and v3? Today we support v3 and I'm concerned that just changing to v4 may cause issues for existing users.

wolfeidau commented 4 years ago

@sapessi you make a very good point, with libraries like this it may require a new package or function to indicate different major versions.

My experience due to the namespace changes you need to be explicit about echo vs v4.

Did you want me to refactor this PR to be echov4 in a separate file / package?

sapessi commented 4 years ago

I would probably create it as a separate echov4 folder. However, we'd have to include both echo v3 and v4 as dependencies - it's all one module at the moment - that is going to be a bit of a hellish experience. Do you have alternatives?

wolfeidau commented 4 years ago

I think this repo is a good case for moving to a multi module project. This would look as follows:

  1. create a new echov4 folder in this repo and add my code.
  2. mod init in that folder for github.com/awslabs/aws-lambda-go-api-proxy/echov4
  3. mod init in echo folder for github.com/awslabs/aws-lambda-go-api-proxy/echo
  4. mod tidy in the root folder which will remove the deps of these sub modules
  5. Push a new release under a new tag which will publish two new modules with matching tags.

The result is that github.com/awslabs/aws-lambda-go-api-proxy/echov4 will depend on echov4 and github.com/awslabs/aws-lambda-go-api-proxy but not the other way around.

Have a read of the process here.

https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository

I plan to try this on another copy of this repo for my own benefit but I believe it would reduce the hellish web of dependencies.

sapessi commented 4 years ago

Making this entire repo multi-module has been on my list for a while. I haven't had a chance to get to it.

excavador commented 4 years ago

Can we please merge this PR?

lucasmdomingues commented 4 years ago

Can we please merge this PR?

nnajiabraham commented 3 years ago

Just checking on this, any update or action item required for this to be merged, or could we just go ahead with adding the echov4 if making this a multi-module repo is a more complex task?