Removed warnings from go staticcheck

This commit is contained in:
gezimbll
2023-11-03 12:20:48 -04:00
committed by Dan Christian Bogos
parent 529430bd4d
commit c2dacc42c1
97 changed files with 334 additions and 761 deletions

View File

@@ -246,7 +246,7 @@ func (ka *KamailioAgent) onCallEnd(evData []byte, connIdx int) {
utils.KamailioAgent, kev[utils.OriginID], err.Error()))
// no return here since we want CDR anyhow
}
if ka.cfg.CreateCdr || strings.Index(kev[utils.CGRFlags], utils.MetaCDRs) != -1 {
if ka.cfg.CreateCdr || strings.Contains(kev[utils.CGRFlags], utils.MetaCDRs) {
if err := ka.connMgr.Call(ka.ctx, ka.cfg.SessionSConns,
utils.SessionSv1ProcessCDR,
tsArgs.CGREvent, &reply); err != nil {

View File

@@ -34,9 +34,7 @@ func newDnsReply(req *dns.Msg) (rply *dns.Msg) {
rply.SetReply(req)
if len(req.Question) > 0 {
rply.Question = make([]dns.Question, len(req.Question))
for i, q := range req.Question {
rply.Question[i] = q
}
copy(rply.Question, req.Question)
}
if opts := rply.IsEdns0(); opts != nil {
rply.SetEdns0(4096, false).IsEdns0().Option = opts.Option