netutil.go 473 B

12345678910111213141516171819
  1. // Copyright (C) 2023 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. package netutil
  7. import "net/url"
  8. // Address constructs a URL from the given network and hostname.
  9. func AddressURL(network, host string) string {
  10. u := url.URL{
  11. Scheme: network,
  12. Host: host,
  13. }
  14. return u.String()
  15. }