platforms: provide simpler function for common use
Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
@@ -6,8 +6,13 @@ import (
|
||||
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
// Default returns the current platform's default platform specification.
|
||||
func Default() specs.Platform {
|
||||
// Default returns the default specifier for the platform.
|
||||
func Default() string {
|
||||
return Format(DefaultSpec())
|
||||
}
|
||||
|
||||
// DefaultSpec returns the current platform's default platform specification.
|
||||
func DefaultSpec() specs.Platform {
|
||||
return specs.Platform{
|
||||
OS: runtime.GOOS,
|
||||
Architecture: runtime.GOARCH,
|
||||
|
||||
Reference in New Issue
Block a user