runtime: Fix gofmt issues

It seems that bumping the version of golang and golangci-lint new format
changes are required.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio
2022-11-17 13:52:54 +01:00
parent 16b8375095
commit d94718fb30
21 changed files with 81 additions and 82 deletions

View File

@@ -87,15 +87,16 @@ func getKernelVersion() (string, error) {
// Examples of actual kernel versions which can be made into valid semver
// format by calling this function:
//
// centos: 3.10.0-957.12.1.el7.x86_64
// fedora: 5.0.9-200.fc29.x86_64
// centos: 3.10.0-957.12.1.el7.x86_64
// fedora: 5.0.9-200.fc29.x86_64
//
// For some self compiled kernel, the kernel version will be with "+" as its suffix
// For example:
// 5.12.0-rc4+
//
// 5.12.0-rc4+
//
// These kernel version can't be parsed by the current lib and lead to panic
// therefore the '+' should be removed.
//
func fixKernelVersion(version string) string {
version = strings.Replace(version, "_", "-", -1)
return strings.Replace(version, "+", "", -1)

View File

@@ -84,12 +84,12 @@ func NewTestConstraint(debug bool) TestConstraint {
//
// Notes:
//
// - Constraints are applied in the order specified.
// - A constraint type (user, kernel) can only be specified once.
// - If the function fails to determine whether it can check the constraints,
// it will panic. Since this is facility is used for testing, this seems like
// the best approach as it unburdens the caller from checking for an error
// (which should never be ignored).
// - Constraints are applied in the order specified.
// - A constraint type (user, kernel) can only be specified once.
// - If the function fails to determine whether it can check the constraints,
// it will panic. Since this is facility is used for testing, this seems like
// the best approach as it unburdens the caller from checking for an error
// (which should never be ignored).
func (tc *TestConstraint) NotValid(constraints ...Constraint) bool {
if len(constraints) == 0 {
panic("need atleast one constraint")