From ed855d6c6cdf98e725c70311b365d3ad8767c94b Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 2 Mar 2019 04:42:19 +0900 Subject: [PATCH] audio: Refactoring: remove the unused returning value --- audio/audio.go | 6 +----- audio/context.go | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/audio/audio.go b/audio/audio.go index fa9f4cef0..33a0ef3ca 100644 --- a/audio/audio.go +++ b/audio/audio.go @@ -88,13 +88,9 @@ func NewContext(sampleRate int) (*Context, error) { ch := make(chan struct{}) - context, err := newContext(sampleRate, ch) - if err != nil { - return nil, err - } c := &Context{ sampleRate: sampleRate, - c: context, + c: newContext(sampleRate, ch), initCh: ch, } theContext = c diff --git a/audio/context.go b/audio/context.go index 3719bb0fe..d89cbe68e 100644 --- a/audio/context.go +++ b/audio/context.go @@ -91,12 +91,12 @@ func (p *otoPlayer) ensurePlayer() error { return nil } -func newContext(sampleRate int, initCh <-chan struct{}) (context, error) { +func newContext(sampleRate int, initCh <-chan struct{}) context { if contextForTesting != nil { - return contextForTesting, nil + return contextForTesting } return &otoContext{ sampleRate: sampleRate, initCh: initCh, - }, nil + } }