shrunk go sample
This commit is contained in:
parent
5733789514
commit
3c98feb341
@ -14,9 +14,7 @@ type Packet struct {
|
||||
|
||||
func main() {
|
||||
tun, err := taptun.NewTun("nc%d")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err != nil { panic(err) }
|
||||
|
||||
inboundPackets := make(chan Packet, 128)
|
||||
|
||||
@ -26,13 +24,9 @@ func main() {
|
||||
|
||||
for {
|
||||
read, err := tun.Read(buffer)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err != nil { panic(err) }
|
||||
|
||||
if read == 0 {
|
||||
panic("0 bytes read!")
|
||||
}
|
||||
if read == 0 { panic("0 bytes read!") }
|
||||
|
||||
p := Packet{}
|
||||
p.Data = make([]byte, read)
|
||||
|
Loading…
Reference in New Issue
Block a user