all: update to Go 1.20, use strings.CutPrefix/Suffix instead of our fork

Updates #7123
Updates #5309

Change-Id: I90bcd87a2fb85a91834a0dd4be6e03db08438672
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-02-01 13:43:06 -08:00
committed by Brad Fitzpatrick
parent 623176ebc9
commit b1248442c3
34 changed files with 73 additions and 147 deletions

View File

@@ -13,8 +13,6 @@ import (
"sort"
"strings"
"sync"
"tailscale.com/util/strs"
)
// dohOfIP maps from public DNS IPs to their DoH base URL.
@@ -82,7 +80,7 @@ func DoHIPsOfBase(dohBase string) []netip.Addr {
if s := dohIPsOfBase[dohBase]; len(s) > 0 {
return s
}
if hexStr, ok := strs.CutPrefix(dohBase, "https://dns.nextdns.io/"); ok {
if hexStr, ok := strings.CutPrefix(dohBase, "https://dns.nextdns.io/"); ok {
// The path is of the form /<profile-hex>[/<hostname>/<model>/<device id>...]
// or /<profile-hex>?<query params>
// but only the <profile-hex> is required. Ignore the rest: