aluttik / go-crossplane

An unofficial Go port of the NGINX config/JSON converter crossplane
Apache License 2.0
50 stars 15 forks source link

Fix panic when removing parenthesis from if directives #13

Closed andrerfcsantos closed 3 years ago

andrerfcsantos commented 3 years ago

Fixes https://github.com/aluttik/go-crossplane/issues/12

The problem where was that e was pointing to the last position of the d.Args slice, but when an ( parenthesis was removed from the slice, e was not being updated with the new last position of the slice. This PR fixes it.

Added a new test along with this change.

aluttik commented 3 years ago

Thanks for the contribution!