Fixed config handler

This commit is contained in:
frr
2019-01-15 14:36:52 +01:00
parent e29085bab4
commit 33bbff0197
3 changed files with 23 additions and 12 deletions

View File

@@ -1,10 +1,13 @@
package utils
import (
"github.com/xfrr/goffmpeg/models"
"bytes"
"os/exec"
"runtime"
"strconv"
"strings"
"github.com/xfrr/goffmpeg/models"
)
func DurToSec(dur string) (sec float64) {
@@ -72,3 +75,19 @@ func LineSeparator() string {
return "\n"
}
}
// TestCmd ...
func TestCmd(command string, args string) (bytes.Buffer, error) {
var out bytes.Buffer
cmd := exec.Command(command, args)
cmd.Stdout = &out
err := cmd.Run()
if err != nil {
return out, err
}
return out, nil
}