Skip to content

Commit

Permalink
Merge pull request #86 from testwill/ioutil
Browse files Browse the repository at this point in the history
chore: remove refs to deprecated io/ioutil
  • Loading branch information
olahol authored Apr 16, 2024
2 parents 7ad55bd + ca7f6ac commit 91a7aa7
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 91a7aa7

Please sign in to comment.