diff --git a/handler.go b/handler.go index 5e97464..490aef0 100644 --- a/handler.go +++ b/handler.go @@ -609,8 +609,7 @@ type opusChannel struct { Error error } -// func channelToIOReadCloser(ctx context.Context, ch chan []byte) io.ReadCloser { -func channelToIOReadCloser(ctx context.Context, ch chan opusChannel) io.ReadCloser { +func opusChannelToIOReadCloser(ctx context.Context, ch chan opusChannel) io.ReadCloser { r, w := io.Pipe() go func() { diff --git a/packet_dump_handler.go b/packet_dump_handler.go index 1af4cb4..e35e855 100644 --- a/packet_dump_handler.go +++ b/packet_dump_handler.go @@ -75,7 +75,7 @@ func (h *PacketDumpHandler) Handle(ctx context.Context, opusCh chan opusChannel) r, w := io.Pipe() - reader := channelToIOReadCloser(ctx, opusCh) + reader := opusChannelToIOReadCloser(ctx, opusCh) go func() { f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) diff --git a/test_handler.go b/test_handler.go index e22f3af..005ea90 100644 --- a/test_handler.go +++ b/test_handler.go @@ -76,7 +76,7 @@ func (h *TestHandler) ResetRetryCount() int { func (h *TestHandler) Handle(ctx context.Context, opusCh chan opusChannel) (*io.PipeReader, error) { r, w := io.Pipe() - reader := channelToIOReadCloser(ctx, opusCh) + reader := opusChannelToIOReadCloser(ctx, opusCh) go func() { encoder := json.NewEncoder(w)