mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
refactor: move from io/ioutil to io and os package (#1772)
The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@ package ffmpeg
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
@@ -126,7 +126,7 @@ func (e *Encoder) runTranscode(probeResult VideoFile, args []string) (string, er
|
||||
}
|
||||
}
|
||||
|
||||
stdoutData, _ := ioutil.ReadAll(stdout)
|
||||
stdoutData, _ := io.ReadAll(stdout)
|
||||
stdoutString := string(stdoutData)
|
||||
|
||||
registerRunningEncoder(probeResult.Path, cmd.Process)
|
||||
|
||||
@@ -2,7 +2,6 @@ package ffmpeg
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -234,7 +233,7 @@ func (e *Encoder) stream(probeResult VideoFile, options TranscodeStreamOptions)
|
||||
|
||||
// stderr must be consumed or the process deadlocks
|
||||
go func() {
|
||||
stderrData, _ := ioutil.ReadAll(stderr)
|
||||
stderrData, _ := io.ReadAll(stderr)
|
||||
stderrString := string(stderrData)
|
||||
if len(stderrString) > 0 {
|
||||
logger.Debugf("[stream] ffmpeg stderr: %s", stderrString)
|
||||
|
||||
Reference in New Issue
Block a user