]> go.fuhry.dev Git - runtime.git/commit
utils/hostname: handle special case of domain name = "(none)" on linux
authorDan Fuhry <dan@fuhry.com>
Fri, 13 Sep 2024 00:17:37 +0000 (20:17 -0400)
committerDan Fuhry <dan@fuhry.com>
Fri, 13 Sep 2024 00:17:37 +0000 (20:17 -0400)
commit3ad0365f186491093e261d43c745fb63cb94c22d
treec8b0ce0b390857c6c3529e24730f97fe5df8addd
parent59602ff7732a8dfb65a647618d327657ae23a3f2
utils/hostname: handle special case of domain name = "(none)" on linux

Linux systems can return interesting values when the domain name is
unset, like "(none)" or an empty string. To handle these, hostname.go is
forked with special Hostname(), DomainName() and RegionName()
implementations for Linux and the original implementations for other
OSes.
utils/hostname/hostname.go
utils/hostname/hostname_generic.go [new file with mode: 0644]
utils/hostname/hostname_linux.go [new file with mode: 0644]
utils/hostname/hostname_macos.go
utils/hostname/hostname_openbsd.go