platform: Information About the Platform

Table of Content:

Introduction

The platform: module provides access to the platform’s identifying data.

Variables

$platform:arch

The architecture of the platform; e.g. amd64, arm, ppc. This corresponds to Go’s GOARCH constant. This is read-only.

$platform:is-unix

Whether or not the platform is UNIX-like. This includes Linux, macOS (Darwin), FreeBSD, NetBSD, and OpenBSD. This can be used to decide, for example, if the unix module is usable. This is read-only.

$platform:is-windows

Whether or not the platform is Microsoft Windows. This is read-only.

$platform:os

The name of the operating system; e.g. darwin (macOS), linux, etc. This corresponds to Go’s GOOS constant. This is read-only.