Skip to content

Commit

Permalink
chore: remove refs to deprecated io/ioutil
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Jul 12, 2023
1 parent b889a36 commit ca7f6ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/filewatch/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"io/ioutil"
"net/http"
"os"

"github.com/fsnotify/fsnotify"
"github.com/olahol/melody"
Expand All @@ -23,15 +23,15 @@ func main() {
})

m.HandleConnect(func(s *melody.Session) {
content, _ := ioutil.ReadFile(file)
content, _ := os.ReadFile(file)
s.Write(content)
})

go func() {
for {
ev := <-w.Events
if ev.Op == fsnotify.Write {
content, _ := ioutil.ReadFile(ev.Name)
content, _ := os.ReadFile(ev.Name)
m.Broadcast(content)
}
}
Expand Down

0 comments on commit ca7f6ac

Please sign in to comment.