Jelajahi Sumber

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>
Sebastiaan van Stijn 2 tahun lalu
induk
melakukan
5c78cbd3be
2 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 1 1
      daemon/info.go
  2. 2 0
      pkg/platform/platform.go

+ 1 - 1
daemon/info.go

@@ -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(),

+ 2 - 0
pkg/platform/platform.go

@@ -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() {