Skip to content

Commit

Permalink
fix: update practices from deprecated ioutil to os (#4699)
Browse files Browse the repository at this point in the history
  • Loading branch information
OremGLG authored Dec 11, 2024
1 parent 495129f commit aa1f635
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions speech/snippets/enhanced_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package snippets
import (
"fmt"
"io"
"io/ioutil"
"os"
"strings"

// [START imports]
Expand All @@ -40,7 +40,7 @@ func enhancedModel(w io.Writer) error {
}
defer client.Close()

data, err := ioutil.ReadFile("../testdata/commercial_mono.wav")
data, err := os.ReadFile("../testdata/commercial_mono.wav")
if err != nil {
return fmt.Errorf("ReadFile: %w", err)
}
Expand All @@ -59,7 +59,7 @@ func enhancedModel(w io.Writer) error {
},
})
if err != nil {
return fmt.Errorf("Recognize: %w", err)
return fmt.Errorf("client.Recognize: %w", err)
}

for i, result := range resp.Results {
Expand Down

0 comments on commit aa1f635

Please sign in to comment.