objectbox / objectbox-go

Embedded Go Database, the fast alternative to SQLite, gorm, etc.
https://objectbox.io
Apache License 2.0
1.07k stars 46 forks source link

Version.LessThan() function not working properly #48

Open josh-hogle opened 10 months ago

josh-hogle commented 10 months ago

Description

When using v0.19.0 of the Go library with v0.19.0 of the C library, I get the following warning message:

Note: the loaded ObjectBox C library should be updated.
      Found ObjectBox version 0.19.0, but the minimum recommended version is 0.18.1.

Basic info

Please complete the following information:

How to reproduce

Simply build a small demo program similar to the getting started example and compile it and you should get the warning.

Expected behavior

No warning(s) should be emitted as the "C" library is greater than/equal to the Go library version.

Code

Check the LessThan() function in version.go on line 35. It appears to me that this may be causing the issue. You may also want to just use the golang.org/x/mod/semver package to simplify your version comparison and management.