File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "reflect"
77 "testing"
88 "time"
9+ "unsafe"
910
1011 "github.com/go-test/deep"
1112 v1 "github.com/go-test/deep/test/v1"
@@ -313,8 +314,12 @@ func TestMaxDiff(t *testing.T) {
313314func TestNotHandled (t * testing.T ) {
314315 // UnsafePointer is pretty much the only kind not handled now
315316 v := []int {1 }
316- a := reflect .ValueOf (v ).UnsafePointer ()
317- b := reflect .ValueOf (v ).UnsafePointer ()
317+ a := unsafe .Pointer (& v )
318+ b := unsafe .Pointer (& v )
319+ // UnsafePointer added in Go 1.88. Use these lines once this pkg
320+ // no longer supports Go 1.17.
321+ //a := reflect.ValueOf(v).UnsafePointer()
322+ //b := reflect.ValueOf(v).UnsafePointer()
318323 diff := deep .Equal (a , b )
319324 if len (diff ) > 0 {
320325 t .Error ("got diffs:" , diff )
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ go test -coverprofile=coverage.out " $@ "
3+ go tool cover -html=coverage.out
You can’t perform that action at this time.
0 commit comments