X-Git-Url: http://www.git.cypherpunks.ru/?p=goircd.git;a=blobdiff_plain;f=goircd.go;fp=goircd.go;h=6168eaf62d1dd4fa416cb3f9f7b41681fa5d7e68;hp=ddf81286a1ff07cf6daa982fc571a134f5e096a7;hb=6f9d7fae374e5ada6c33f585db748f23fbc49f91;hpb=14b38769cdece09d57423873043372ff724fc249 diff --git a/goircd.go b/goircd.go index ddf8128..6168eaf 100644 --- a/goircd.go +++ b/goircd.go @@ -20,7 +20,6 @@ package main import ( "crypto/tls" "flag" - "io/ioutil" "log" "net" "os" @@ -144,7 +143,7 @@ func main() { log.Fatalln("can not read statedir", err) } for _, state := range states { - buf, err := ioutil.ReadFile(path.Join(state, StateTopicFilename)) + buf, err := os.ReadFile(path.Join(state, StateTopicFilename)) if err != nil { log.Fatalf( "can not read state %s/%s: %v", @@ -153,7 +152,7 @@ func main() { } room := RoomRegister(path.Base(state)) room.topic = strings.TrimRight(string(buf), "\n") - buf, err = ioutil.ReadFile(path.Join(state, StateKeyFilename)) + buf, err = os.ReadFile(path.Join(state, StateKeyFilename)) if err == nil { room.key = strings.TrimRight(string(buf), "\n") } else { @@ -178,7 +177,7 @@ func main() { } topicPath := path.Join(statePath, StateTopicFilename) - if err := ioutil.WriteFile( + if err := os.WriteFile( topicPath, []byte(event.topic+"\n"), permStateFile, @@ -188,7 +187,7 @@ func main() { } keyPath := path.Join(statePath, StateKeyFilename) - if err := ioutil.WriteFile( + if err := os.WriteFile( keyPath, []byte(event.key+"\n"), permStateFile,