go - How to compare two version number strings in golang -
i have 2 strings (they version numbers , version numbers)
a := "1.05.00.0156" b := "1.0.221.9289"
i want compare 1 bigger. how in golang?
convert "1.05.00.0156" "0001"+"0005"+"0000"+"0156", int64.
convert "1.0.221.9289" "0001"+"0000"+"0221"+"9289", int64.
compare 2 int64 values.
try on go playground
Comments
Post a Comment