Use latest protoreflect to fix some bugs (#453)

* update to latest jhump/protoreflect

* be lenient when possible if server cannot furnish all dependencies

* move linting back to go 1.21 instead of latest go 1.22

* make staticcheck happy
This commit is contained in:
Joshua Humphries
2024-04-09 17:50:10 -04:00
committed by GitHub
parent 8e76884d21
commit 07361b21ea
8 changed files with 99 additions and 76 deletions

View File

@@ -7,7 +7,6 @@ import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net"
"os"
"os/signal"
@@ -130,7 +129,7 @@ type svr struct {
}
func (s *svr) load() error {
accts, err := ioutil.ReadFile(s.datafile)
accts, err := os.ReadFile(s.datafile)
if err != nil && !os.IsNotExist(err) {
return err
}
@@ -162,7 +161,7 @@ func (s *svr) flush() {
if b, err := json.Marshal(accounts); err != nil {
grpclog.Errorf("failed to save data to %q", s.datafile)
} else if err := ioutil.WriteFile(s.datafile, b, 0666); err != nil {
} else if err := os.WriteFile(s.datafile, b, 0666); err != nil {
grpclog.Errorf("failed to save data to %q", s.datafile)
}
}