recorder/main.go
func readAllAsync(f io.ReadCloser) (*[]byte, chan struct{}) {
	done := make(chan struct{}, 1) // signal that the read is done
	var buf []byte                 // placeholder buffer for the result
	go func() {
		var err error
		buf, err = ioutil.ReadAll(f)
		if err != nil {
			buf = make([]byte, 0)
		}
		f.Close()
		done <- struct{}{}
	}()
	return &buf, done
}
func readAllAsync(f io.ReadCloser) (*[]byte, chan struct{}) {
	done := make(chan struct{}, 1) // signal that the read is done
	var buf []byte                 // placeholder buffer for the result
	go func() {
		var err error
		buf, err = ioutil.ReadAll(f)
		if err != nil {
			buf = make([]byte, 0)
		}
		f.Close()
		done <- struct{}{}
	}()
	return &buf, done
}
// Read file asynchronously