From 18eaeb9a89415e0706571d18a2faabd06504cb95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Sat, 3 Aug 2024 00:47:46 +0000 Subject: [PATCH] Add comment --- common/net/address.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/net/address.go b/common/net/address.go index a5f7c160822d..1567e4d19c5e 100644 --- a/common/net/address.go +++ b/common/net/address.go @@ -121,6 +121,11 @@ func IPAddress(ip []byte) Address { } // DomainAddress creates an Address with given domain. +// This is an internal function that forcibly converts a string to domain. +// It's mainly used in test files and mux. +// Unless you have a specific reason, use net.ParseAddress instead, +// as this function does not check whether the input is an IP address. +// Otherwise, you will get strange results like domain: 1.1.1.1 func DomainAddress(domain string) Address { return domainAddress(domain) }