mirror of
https://github.com/yggdrasil-network/water.git
synced 2025-05-19 16:35:10 +03:00
add test that fails on go1.10.*
This commit is contained in:
parent
f7eb3ca99f
commit
af2921498b
4 changed files with 20 additions and 9 deletions
|
@ -8,14 +8,16 @@ import (
|
|||
|
||||
const BUFFERSIZE = 1522
|
||||
|
||||
func startRead(ch chan<- []byte, ifce *Interface) {
|
||||
func startRead(t *testing.T, ifce *Interface, dataCh chan<- []byte, errCh chan<- error) {
|
||||
go func() {
|
||||
for {
|
||||
buffer := make([]byte, BUFFERSIZE)
|
||||
n, err := ifce.Read(buffer)
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
errCh <- err
|
||||
} else {
|
||||
buffer = buffer[:n:n]
|
||||
ch <- buffer
|
||||
dataCh <- buffer
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue