From bb44eebe7818c6381abd39711d750dd77209e1b3 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 26 Dec 2017 00:10:30 +0900 Subject: [PATCH] audio/mp3: Replace magic numbers with consts in io package --- audio/mp3/decode_js.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/mp3/decode_js.go b/audio/mp3/decode_js.go index d181db1c9..195f140a1 100644 --- a/audio/mp3/decode_js.go +++ b/audio/mp3/decode_js.go @@ -77,11 +77,11 @@ func (s *Stream) Read(b []byte) (int, error) { func (s *Stream) Seek(offset int64, whence int) (int64, error) { next := int64(0) switch whence { - case 0: + case io.SeekStart: next = offset - case 1: + case io.SeekCurrent: next = int64(s.posInBytes) + offset - case 2: + case io.SeekEnd: next = s.Size() + offset } s.posInBytes = int(next)