Skip to content

Commit 5c78cbd

Browse files
committed
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 <[email protected]>
1 parent cf9a76f commit 5c78cbd

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

daemon/info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (daemon *Daemon) SystemInfo() *types.Info {
4444
OperatingSystem: operatingSystem(),
4545
OSVersion: osVersion(),
4646
IndexServerAddress: registry.IndexServer,
47-
OSType: platform.OSType,
47+
OSType: runtime.GOOS,
4848
Architecture: platform.Architecture,
4949
RegistryConfig: daemon.registryService.ServiceConfig(),
5050
NCPU: sysinfo.NumCPU(),

pkg/platform/platform.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ var Architecture string
1919

2020
// OSType holds the runtime operating system type of the process. It is
2121
// an alias for [runtime.GOOS].
22+
//
23+
// Deprecated: use [runtime.GOOS] instead.
2224
const OSType = runtime.GOOS
2325

2426
func init() {

0 commit comments

Comments
 (0)