Help us shape the future of Go! Take the 2026 Go Developer Survey

identity

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package identity provides hostname and hardware serial lookups for machine identification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hostname

func Hostname() (string, error)

Hostname returns the system hostname.

func NormalizeSerial

func NormalizeSerial(raw string) string

NormalizeSerial returns the trimmed serial, or "" when raw is empty or a known placeholder.

func SerialNumber

func SerialNumber() (string, error)

SerialNumber returns the hardware serial number. An error means the query failed or timed out. An empty string with a nil error means no usable serial is available. On timeout the query is not canceled: the Windows WMI query cannot be canceled and keeps running in the background, and later calls wait on it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL