shrunk go sample

This commit is contained in:
Jake Hillion 2020-12-28 11:46:59 +00:00
parent 5733789514
commit 3c98feb341

View File

@ -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)