# SPDX-FileCopyrightText: 2022 Masatoshi Nishiguchi # SPDX-FileCopyrightText: 2023 Frank Hunleth # # SPDX-License-Identifier: Apache-2.0 # defmodule Toolshed.Core.Hostname do require Record @doc """ Return the hostname ## Examples iex> hostname "nerves-1234" """ @spec hostname() :: String.t() def hostname() do {:ok, hostname_charlist} = :inet.gethostname() to_string(hostname_charlist) end end