Enable errcheck linter and resolve found issues.

Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
This commit is contained in:
Xun Jiang
2023-04-27 20:39:53 +08:00
parent fbba4e5c77
commit f051ecaee9
19 changed files with 124 additions and 41 deletions

View File

@@ -87,7 +87,9 @@ func (c *ObjectStoreGRPCClient) PutObject(bucket, key string, body io.Reader) er
return nil
}
if err != nil {
stream.CloseSend()
if err := stream.CloseSend(); err != nil {
return common.FromGRPCError(err)
}
return errors.WithStack(err)
}

View File

@@ -232,7 +232,10 @@ func getNames(command string, kind common.PluginKind, plugin Interface) []Plugin
func (s *server) Serve() {
if s.flagSet != nil && !s.flagSet.Parsed() {
s.log.Debugf("Parsing flags")
s.flagSet.Parse(os.Args[1:])
if err := s.flagSet.Parse(os.Args[1:]); err != nil {
s.log.Errorf("fail to parse the flags: %s", err.Error())
return
}
}
s.log.Level = s.logLevelFlag.Parse()