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

@@ -7,11 +7,11 @@ import (
"fmt"
"net/netip"
"reflect"
"strings"
"testing"
"go4.org/mem"
"tailscale.com/types/key"
"tailscale.com/util/strs"
)
func TestMarshalAndParse(t *testing.T) {
@@ -71,7 +71,7 @@ func TestMarshalAndParse(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
foo := []byte("foo")
got := string(tt.m.AppendMarshal(foo))
got, ok := strs.CutPrefix(got, "foo")
got, ok := strings.CutPrefix(got, "foo")
if !ok {
t.Fatalf("didn't start with foo: got %q", got)
}