Go version

go version go1.20.13 linux/amd64

Output of go env in your module/workspace:

GOVERSION="go1.20.13"
GOROOT="/usr/lib/go"

What did you do?

git clone https://go.googlesource.com/crypto go test ./...

What did you see happen?

ssh/server_test.go:12:2: package slices is not in GOROOT (/usr/lib/go/src/slices) FAIL golang.org/x/crypto/ssh [setup failed]

What did you expect to see?

Success.

The go.mod file lists "go 1.20" as a minimum requirement. However it's not possible to run the tests.

Comment From: imirkin

A minimal patch:

diff --git a/ssh/server_test.go b/ssh/server_test.go
index 9057a9b..b6d8ab3 100644
--- a/ssh/server_test.go
+++ b/ssh/server_test.go
@@ -9,7 +9,7 @@ import (
        "fmt"
        "io"
        "net"
-       "slices"
+       "reflect"
        "strings"
        "sync/atomic"
        "testing"
@@ -294,7 +294,7 @@ func TestBannerError(t *testing.T) {
                "banner from PublicKeyCallback",
                "banner from KeyboardInteractiveCallback",
        }
-       if !slices.Equal(banners, wantBanners) {
+       if !reflect.DeepEqual(banners, wantBanners) {
                t.Errorf("got banners:\n%q\nwant banners:\n%q", banners, wantBanners)
        }
 }

I realize it's a lot less efficient, but it's a short list and it'll be easy to switch it back to slices when go 1.21+ is required?

Comment From: seankhliao

cc @drakkan @golang/security

Comment From: gopherbot

Change https://go.dev/cl/598775 mentions this issue: ssh: remove go 1.21+ dependency on slices