[go-nuts] Channels not working

2016-08-05 Thread Jon Strauss
Hello, I have the following code: package main import "fmt" import "encoding/hex" import "os" func main() { var bytes []byte var channel chan []byte file,_ := os.OpenFile("/dev/random", os.O_RDONLY, 0) bytes = make([]byte,20) _, _ = file.Read(bytes) ch

[go-nuts] Re: Channels not working

2016-08-05 Thread Jon Strauss
nel. Once the main > goroutine returns, the program will exit. > > On Saturday, 6 August 2016 08:38:54 UTC+10, Jon Strauss wrote: >> >> Hello, >> I have the following code: >> >> package main >> >> import "fmt" >> import

[go-nuts] Bug in go? Package net

2016-09-25 Thread Jon Strauss
This error: panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x20 pc=0x401487] goroutine 1 [running]: panic(0x50bfa0, 0xc82000a0c0) /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6 main.main() /root/Whois3/rest-whois-threaded/main.go:65 +0x67