Skip to content

Commit bcc0d8f

Browse files
alecthomasclaude
andcommitted
refactor: replace deprecated ioutil.ReadAll with io.ReadAll
io/ioutil has been deprecated since Go 1.16. Also updates the README usage example to match. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent b151274 commit bcc0d8f

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ if formatter == nil {
165165
Then obtain an iterator over the tokens:
166166

167167
```go
168-
contents, err := ioutil.ReadAll(r)
168+
contents, err := io.ReadAll(r)
169169
iterator, err := lexer.Tokenise(nil, string(contents))
170170
```
171171

cmd/chroma/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"fmt"
77
"io"
8-
"io/ioutil"
98
"iter"
109
"os"
1110
"os/signal"
@@ -89,7 +88,7 @@ func (n *nopFlushableWriter) Flush() error { return nil }
8988

9089
// prepareLenient prepares contents and lexer for input, using fallback lexer if no specific one is available for it.
9190
func prepareLenient(r io.Reader, filename string) (string, chroma.Lexer, error) {
92-
data, err := ioutil.ReadAll(r)
91+
data, err := io.ReadAll(r)
9392
if err != nil {
9493
return "", nil, err
9594
}

0 commit comments

Comments
 (0)