From 5aba05d7237c2250e647a717f8abef658f30a9e9 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 1 Jul 2023 22:02:01 +0800 Subject: Refactor: replace homemade error type checking with idiom Go practices. --- recording/runner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'recording/runner.go') diff --git a/recording/runner.go b/recording/runner.go index 4145d5f..8f892fa 100644 --- a/recording/runner.go +++ b/recording/runner.go @@ -323,7 +323,7 @@ func record( logger.Info("Recording live stream to file \"%v\"...", filePath) return }, writeBufferSize) - if common.IsErrorOfType(err, &common.UnrecoverableTaskError{}) { + if _, ok := err.(*common.UnrecoverableTaskError); ok { logger.Error("Cannot record: %v", err) return err } else if errors.Is(err, context.Canceled) || err == nil { -- cgit v1.2.3