• Filippo Valsorda's avatar
    crypto/tls: replace custom equal implementations with reflect.DeepEqual · f6b554fe
    Filippo Valsorda authored
    The equal methods were only there for testing, and I remember regularly
    getting them wrong while developing tls-tris. Replace them with simple
    reflect.DeepEqual calls.
    
    The only special thing that equal() would do is ignore the difference
    between a nil and a zero-length slice. Fixed the Generate methods so
    that they create the same value that unmarshal will decode. The
    difference is not important: it wasn't tested, all checks are
    "len(slice) > 0", and all cases in which presence matters are
    accompanied by a boolean.
    
    Change-Id: Iaabf56ea17c2406b5107c808c32f6c85b611aaa8
    Reviewed-on: https://go-review.googlesource.com/c/144114
    Run-TryBot: Filippo Valsorda <filippo@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAdam Langley <agl@golang.org>
    f6b554fe
ticket.go 4.27 KB