Use existing error variable instead of creating a initializing a new one

This commit is contained in:
ionutboangiu
2022-10-19 19:03:01 +03:00
committed by Dan Christian Bogos
parent 60a4da69e0
commit 2abfd046f0

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package servmanager
import (
"errors"
"fmt"
"sync"
@@ -300,7 +299,7 @@ func toggleService(serviceID string, status bool, srvMngr *ServiceManager) (err
srvMngr.cfg.SIPAgentCfg().Enabled = status
srvMngr.cfg.GetReloadChan() <- serviceID
default:
err = errors.New(utils.UnsupportedServiceIDCaps)
err = utils.ErrUnsupportedServiceID
}
return
}