死机:运行时错误:内存地址无效或无指针取消引用当我添加statusCOD, err := c.route.FindStatusCODByOrigin(ctx, req.Origin) if err != nil { if err != sql.ErrNoRows { ddlogger.Log(ctx, span, "Find status cod destination and cod origin", err) errChan <- err return } } if statusCOD != nil { IsCODOrigin = statusCOD.IsCODOrigin IsCODDestination = statusCOD.IsCODDestination }在这个功能中for i, v := range detailShipments { var dtPackage repo.PackageBaseModel go func(idx int, vShipment repo.ShipmentDetailBaseModel, dataShipmentNew repo.ShipmentCODCreateModel) { defer wg1.Done() randomID := commonString.RandomWithCustomCharList(c.config.ShipmentCODIDRandom, c.config.ShipmentIDCharlist) shipmentID := fmt.Sprintf("%s%s", prefix, randomID) dataShipmentNew.ShipmentBaseModel.ShipmentID = strings.ToUpper(shipmentID) dataShipmentNew.ShipmentDetailBaseModel = vShipment var commodityName string sCategory, err := c.shipmentCategoryRepo.FindOneShipmentCategoryByID(ctx, vShipment.ShipmentCategoryID.Int64) if err != err && err != sql.ErrNoRows { ddlogger.Log(ctx, span, "shipmentService-CreateShipmentCOD "+shipmentID, " Failed shipmentCategoryRepo.FindOneShipmentCategoryByID", err) } else { if sCategory != nil { commodityName = sCategory.CommodityName.String } }
- 1 回答
- 0 关注
- 51 浏览
添加回答
举报
0/150
提交
取消