kernelversion

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package kernelversion provides a method to check whether the running kernel version is at least a minimum kernel version.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GreaterEqualThan

func GreaterEqualThan(minVersion KernelVersion) (bool, error)

GreaterEqualThan checks if the host's kernel version is greater than, or equal to the given kernel version v. Only "kernel version" and "major revision" can be specified (e.g., "3.12") and will be taken into account, which means that 3.12.25-gentoo and 3.12-1-amd64 are considered equal (kernel: 3, major: 12).

Types

type KernelVersion

type KernelVersion struct {
	Kernel uint64 // Version of the Kernel (i.e., the "4" in "4.1.2-generic")
	Major  uint64 // Major revision of the Kernel (i.e., the "1" in "4.1.2-generic")
}

KernelVersion holds information about the kernel.

func (*KernelVersion) String

func (k *KernelVersion) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL