I’ve just started learning go. I’m trying to append some strings to ffmpegArgs slice but when I try to append ffmpegArgs[3:]
I’m aware that in go 1.21 I can use the slices.Insert func, but I don’t understand why the append statement throws error.
ffmpegArgs := []string{
"-ss",
inpoint,
"-i",
inputPath,
"-c",
"copy",
outputPath,
}
if outpoint != "0" {
// ffmpegArgs = slices.Insert(ffmpegArgs, 2, "-to", outpoint)
ffmpegArgs = append(ffmpegArgs[:3], "-to", outpoint, ffmpegArgs[3:]...) // this line errors
}