pkg/platform: deprecate OSType in favor or runtime.GOOS

This const looks to only be there for "convenience", or _possibly_ was created
with future normalization or special handling in mind.

In either case, currently it is just a direct copy (alias) for runtime.GOOS,
and defining our own type for this gives the impression that it's more than
that. It's only used in a single place, and there's no external consumers, so
let's deprecate this const, and use runtime.GOOS instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-04-08 14:40:57 +02:00
parent cf9a76fe8f
commit 5c78cbd3be
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 3 additions and 1 deletions

View file

@ -44,7 +44,7 @@ func (daemon *Daemon) SystemInfo() *types.Info {
OperatingSystem: operatingSystem(),
OSVersion: osVersion(),
IndexServerAddress: registry.IndexServer,
OSType: platform.OSType,
OSType: runtime.GOOS,
Architecture: platform.Architecture,
RegistryConfig: daemon.registryService.ServiceConfig(),
NCPU: sysinfo.NumCPU(),

View file

@ -19,6 +19,8 @@ var Architecture string
// OSType holds the runtime operating system type of the process. It is
// an alias for [runtime.GOOS].
//
// Deprecated: use [runtime.GOOS] instead.
const OSType = runtime.GOOS
func init() {