draffensperger / golp

Go bindings for LPSolve, a Mixed Integer Linear Programming (MILP) solver
MIT License
78 stars 21 forks source link

bugfix: enum type #20

Closed alexykot closed 3 months ago

alexykot commented 4 months ago

Enums PresolveType and SolutionType only had the type declared on the first value in the list. This means that remaining values were not typed and were plain int. This lead to type assertion failure when I tried to test for solution == OPTIMAL. This PR fixes that.

This PR breaks the API slightly as it changes the type of exported constants. I'm not sure if any of the code using this library would be broken by that, but the possibility exists, so I've put this into draft until this is resolved.

This PR is based on PR #18 I've made just earlier, to avoid conflicts. I will rebase this once the other PR is merged. That one should be uncontroversial hopefully.

draffensperger commented 3 months ago

I agree this is the right thing to do. Hopefully it won't be too hard for folks to adopt the new types.