func CompareKernelVersion(a, b *KernelVersionInfo) int {
	if a.Kernel < b.Kernel {
		return -1
	} else if a.Kernel > b.Kernel {
		return 1
	}
	if a.Major < b.Major {
		return -1
	} else if a.Major > b.Major {
		return 1
	}
	if a.Minor < b.Minor {
		return -1
	} else if a.Minor > b.Minor {
		return 1
	}
	return 0
}
Compare two KernelVersionInfo struct.
Returns -1 if a < b, 0 if a == b, 1 it a > b
package kernel
import (
	"bytes"
	"errors"
	"fmt"
)
type KernelVersionInfo struct {
	Kernel int
	Major  int
	Minor  int
	Flavor string
}
func (k *KernelVersionInfo) String() string {
	return fmt.Sprintf("%d.%d.%d%s", k.Kernel, k.Major, k.Minor, k.Flavor)
}