Add amqp support
This commit is contained in:
+2
-2
@@ -52,11 +52,11 @@ func process(scanner *bufio.Scanner, ch chan<- *CanFrame) {
|
||||
}
|
||||
}
|
||||
|
||||
func ReadStdin() <-chan *CanFrame {
|
||||
func ReadStdin(file *os.File) <-chan *CanFrame {
|
||||
c := make(chan *CanFrame)
|
||||
|
||||
go func() {
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
scanner := bufio.NewScanner(file)
|
||||
process(scanner, c)
|
||||
close(c)
|
||||
}()
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@ func Test_fromString(t *testing.T) {
|
||||
want: &CanFrame{
|
||||
Date: &time_m,
|
||||
CanId: 0x4021,
|
||||
Payload: []uint8{00, 00, 00, 00, 0xFC, 0xFF, 0xFF, 0xFF},
|
||||
Payload: &[]uint8{00, 00, 00, 00, 0xFC, 0xFF, 0xFF, 0xFF},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -45,7 +45,7 @@ func Test_fromString(t *testing.T) {
|
||||
want: &CanFrame{
|
||||
Date: &time_p,
|
||||
CanId: 0x100,
|
||||
Payload: []uint8{00, 00, 00, 00, 00, 00, 0x64, 00},
|
||||
Payload: &[]uint8{00, 00, 00, 00, 00, 00, 0x64, 00},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user