[#607] *: Remove redundant if on error returns

Semantic patch:
```
@@
@@
-if err != nil { return err }
-return nil
+return err
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-08-14 14:06:17 +03:00 committed by Evgenii Stratonikov
parent 5a51b78946
commit a8de37c8a2
7 changed files with 8 additions and 39 deletions

View file

@ -246,13 +246,9 @@ func (s *Server) initAlphabetProcessor(cfg *viper.Viper) error {
}
err = bindMorphProcessor(s.alphabetProcessor, s)
if err != nil {
return err
}
return nil
}
func (s *Server) initContainerProcessor(cfg *viper.Viper, cnrClient *container.Client,
frostfsIDClient *frostfsid.Client) error {
// container processor
@ -454,13 +450,9 @@ func (s *Server) initProcessors(cfg *viper.Viper, morphClients *serverMorphClien
}
err = s.initAlphabetProcessor(cfg)
if err != nil {
return err
}
return nil
}
func (s *Server) initMorph(ctx context.Context, cfg *viper.Viper, errChan chan<- error) (*chainParams, error) {
fromSideChainBlock, err := s.persistate.UInt32(persistateSideChainLastBlockKey)
if err != nil {

View file

@ -33,13 +33,9 @@ func (c *Config) Init() error {
}
c.decoder, err = zstd.NewReader(nil)
if err != nil {
return err
}
return nil
}
// NeedsCompression returns true if the object should be compressed.
// For an object to be compressed 2 conditions must hold:
// 1. Compression is enabled in settings.

View file

@ -146,10 +146,7 @@ func (t *boltForest) Init() error {
return err
}
_, err = tx.CreateBucketIfNotExists(logBucket)
if err != nil {
return err
}
return nil
})
}
func (t *boltForest) Close() error {

View file

@ -101,9 +101,5 @@ func (c *Client) UnsubscribeAll() error {
}
err := c.client.UnsubscribeAll()
if err != nil {
return err
}
return nil
}

View file

@ -243,13 +243,9 @@ func (p Preparator) validateParameterOpcodes(ops []Op) error {
}
err = validateNestedArgs(argsLen, ops[:l-2])
if err != nil {
return err
}
return nil
}
func validateNestedArgs(expArgLen int64, ops []Op) error {
var (
currentCode opcode.Opcode

View file

@ -74,13 +74,9 @@ func (n *Writer) Notify(topic string, address oid.Address) error {
}
_, err := n.js.Publish(topic, []byte(address.EncodeToString()), nats.MsgId(messageID))
if err != nil {
return err
}
return nil
}
// New creates new Writer.
func New(oo ...Option) *Writer {
w := &Writer{

View file

@ -102,11 +102,7 @@ func (s *TokenStore) Get(ownerID user.ID, tokenID []byte) (t *storage.PrivateTok
var err error
t, err = s.unpackToken(rawToken)
if err != nil {
return err
}
return nil
})
if err != nil {
s.l.Error(logs.PersistentCouldNotGetSessionFromPersistentStorage,