feat: git init
This commit is contained in:
19
pkg/output/json.go
Normal file
19
pkg/output/json.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package output
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"transcribe/internal/whisper"
|
||||
)
|
||||
|
||||
// JSONFormatter formats transcription results as JSON
|
||||
type JSONFormatter struct{}
|
||||
|
||||
// Format converts transcription result to JSON format
|
||||
func (f *JSONFormatter) Format(result *whisper.TranscriptionResult) (string, error) {
|
||||
data, err := json.MarshalIndent(result, "", " ")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(data), nil
|
||||
}
|
||||
Reference in New Issue
Block a user