code: func ensureTrailingDot(hostname string) string {
  	if net.ParseIP(hostname) != nil {
  		return hostname
  	}
  
  	return strings.TrimSuffix(hostname, ".") + "."
  }
docs: // ensureTrailingDot ensures that the hostname receives a trailing dot if it hasn't already.