feat: add remote config and host metadata

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-02 14:27:39 +08:00
parent 1e7efd9c3b
commit 1e33bfa4bc
4 changed files with 99 additions and 3 deletions
+19
View File
@@ -0,0 +1,19 @@
package hostmeta
import "testing"
func TestHostnameNonEmpty(t *testing.T) {
h, err := Hostname()
if err != nil || h == "" {
t.Fatalf("hostname: %q err=%v", h, err)
}
}
func TestIPsSkipsLoopback(t *testing.T) {
ips := IPs()
for _, ip := range ips {
if ip == "127.0.0.1" || ip == "::1" {
t.Fatalf("loopback in ips: %v", ips)
}
}
}