Files
gonic/transcode/transcoder_none.go
Gregor Zurowski 85eeb860bf feat(ci): update golangci-lint and action (#325)
* Update linter

- Update Github golangci-lint-action to v3
- Update golangci-lint to v1.52.2

* Fix linter issues after updating to linter 1.52.2
2023-05-19 12:05:14 +00:00

29 lines
517 B
Go

package transcode
import (
"context"
"fmt"
"io"
"os"
)
type NoneTranscoder struct{}
var _ Transcoder = (*NoneTranscoder)(nil)
func NewNoneTranscoder() *NoneTranscoder {
return &NoneTranscoder{}
}
func (*NoneTranscoder) Transcode(_ context.Context, _ Profile, in string, out io.Writer) error {
file, err := os.Open(in)
if err != nil {
return fmt.Errorf("open file: %w", err)
}
defer file.Close()
if _, err := io.Copy(out, file); err != nil {
return fmt.Errorf("copy file: %w", err)
}
return nil
}