Open seiyab opened 7 months ago
func (tt *TestCmd) matchExactOutput(want []byte) error {
buf := make([]byte, len(want))
n := 0
tt.withKillTimeout(func() { n, _ = io.ReadFull(tt.stdout, buf) })
buf = buf[:n]
if n < len(want) || !bytes.Equal(buf, want) {
// Grab any additional buffered output in case of mismatch
// because it might help with debugging.
buf = append(buf, make([]byte, tt.stdout.Buffered())...)
Some programmer truncates slice on append. Following code is reported though this doesn't cause unintended preceding zero values.
https://github.com/ethereum/go-ethereum/blob/3c75c64e6bbf64f842c6f725a595713262c2f8fe/accounts/usbwallet/ledger.go#L501-L507