Merge pull request #44393 from thaJeztah/pkg_kernel_duplicate_docs

pkg/parsers/kernel: remove duplicate GoDoc and un-export Utsname
This commit is contained in:
Sebastiaan van Stijn 2022-11-02 23:49:48 +01:00 committed by GitHub
commit 781fd745ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 13 deletions

View file

@ -1,8 +1,6 @@
//go:build linux || freebsd || openbsd
// +build linux freebsd openbsd
// Package kernel provides helper function to get, parse and compare kernel
// versions for different platforms.
package kernel // import "github.com/docker/docker/pkg/parsers/kernel"
import (

View file

@ -2,11 +2,6 @@ package kernel // import "github.com/docker/docker/pkg/parsers/kernel"
import "golang.org/x/sys/unix"
// Utsname represents the system name structure.
// It is passthrough for unix.Utsname in order to make it portable with
// other platforms where it is not available.
type Utsname unix.Utsname
func uname() (*unix.Utsname, error) {
uts := &unix.Utsname{}

View file

@ -7,13 +7,12 @@ import (
"errors"
)
// Utsname represents the system name structure.
// It is defined here to make it portable as it is available on linux but not
// on windows.
type Utsname struct {
// utsName represents the system name structure. It is defined here to make it
// portable as it is available on Linux but not on Windows.
type utsName struct {
Release [65]byte
}
func uname() (*Utsname, error) {
return nil, errors.New("Kernel version detection is available only on linux")
func uname() (*utsName, error) {
return nil, errors.New("kernel version detection is only available on linux")
}