@@ -2,22 +2,22 @@ package farp
22
33import "fmt"
44
5- // Protocol version constants
5+ // Protocol version constants.
66const (
7- // ProtocolVersion is the current FARP protocol version (semver)
8- ProtocolVersion = "1.0.0 "
7+ // ProtocolVersion is the current FARP protocol version (semver).
8+ ProtocolVersion = "1.0.1 "
99
10- // ProtocolMajor is the major version
10+ // ProtocolMajor is the major version.
1111 ProtocolMajor = 1
1212
13- // ProtocolMinor is the minor version
13+ // ProtocolMinor is the minor version.
1414 ProtocolMinor = 0
1515
16- // ProtocolPatch is the patch version
17- ProtocolPatch = 0
16+ // ProtocolPatch is the patch version.
17+ ProtocolPatch = 1
1818)
1919
20- // VersionInfo provides version information about the protocol
20+ // VersionInfo provides version information about the protocol.
2121type VersionInfo struct {
2222 // Version is the full semver string
2323 Version string `json:"version"`
@@ -32,7 +32,7 @@ type VersionInfo struct {
3232 Patch int `json:"patch"`
3333}
3434
35- // GetVersion returns the current protocol version information
35+ // GetVersion returns the current protocol version information.
3636func GetVersion () VersionInfo {
3737 return VersionInfo {
3838 Version : ProtocolVersion ,
@@ -44,10 +44,11 @@ func GetVersion() VersionInfo {
4444
4545// IsCompatible checks if a manifest version is compatible with this protocol version
4646// Compatible means the major version matches and the manifest's minor version
47- // is less than or equal to the protocol's minor version
47+ // is less than or equal to the protocol's minor version.
4848func IsCompatible (manifestVersion string ) bool {
4949 // Parse manifest version (simple parsing for semver)
5050 var major , minor , patch int
51+
5152 _ , err := fmt .Sscanf (manifestVersion , "%d.%d.%d" , & major , & minor , & patch )
5253 if err != nil {
5354 return false
@@ -61,4 +62,3 @@ func IsCompatible(manifestVersion string) bool {
6162 // Protocol must support manifest's minor version or higher
6263 return minor <= ProtocolMinor
6364}
64-
0 commit comments