magus v0.3.0 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
1 min read

platform

Normalize OS/architecture identifiers across naming conventions (aarch64↔arm64, Darwin↔darwin).

Naming convention: import the module under its bare name (import "platform"), reach members with a backslash, and call methods in camelCase: platform\someMethod.

Methods

arch

Normalize an architecture identifier (x86_64, aarch64, armv7l, …) to canonical Go GOARCH (amd64, arm64, arm). With style, render that result in a convention (go|uname); raises on an unknown style. Returns "" when the identifier is unrecognized.

Signature: platform\arch(name, [style]) → string · source

Parameter Type Optional Description
name string
style string yes

Returns: string

os

Normalize an OS identifier (Darwin, macOS, win, …) to canonical Go GOOS (darwin, windows). With style, render that result in a convention (go|uname); raises on an unknown style. Returns "" when the identifier is unrecognized.

Signature: platform\os(name, [style]) → string · source

Parameter Type Optional Description
name string
style string yes

Returns: string

auto-generatedplatformmodulestdlibmagusfile
Last updated (e0463131)
Earlier changes on this page (1)

Full history ↗ · Blame source ↗

Glossary

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. See targets.

Module

A magus stdlib namespace a magusfile imports for host capabilities: filesystem, exec, vcs, and more. See the module reference.

Conventions

This page uses none of the site's convention markers. The full set is on the conventions page.