This commit is contained in:
ge
2026-04-29 21:51:32 +03:00
parent 4ff0e46719
commit 2cdfd18e8b
+2 -2
View File
@@ -5,8 +5,8 @@ fn main() {
// Resolve the fully qualified domain name for host. // Resolve the fully qualified domain name for host.
// This programm is analog for `hostname -f` command. // This programm is analog for `hostname -f` command.
hostname := os.hostname()! hostname := os.hostname()!
ai := netio.addr_info(node: hostname, flags: netio.ai_canonname)! ai := netio.addr_info(node: hostname, flags: netio.ai_canonname) or { []netio.AddrInfo{} }
mut fqdn := '' mut fqdn := hostname
for a in ai { for a in ai {
// Not needed to iterate over all entries, return the first one per getaddrinfo(3). // Not needed to iterate over all entries, return the first one per getaddrinfo(3).
fqdn = a.canonical fqdn = a.canonical