1. Куча / Говнокод #24887

    −4

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    func (incident Incident) DeleteResponsibleMicroservices(microservices []string) {
    	var teamsDelete []string
    	responsibleMss := incident.GetResponsibleMicroservices()
    	for _, microservice := range microservices {
    	ResponsibleMssLoop:
    		for _, responsibleMs := range responsibleMss {
    			if microservice == responsibleMs.MicroserviceId {
    				service.GetInstanceDB().Delete(responsibleMs)
    				if team, ok := GetTeamByMs(microservice); ok != false {
    					for _, ms := range incident.GetResponsibleMicroservices() {
    						if teamFind, ok := GetTeamByMs(ms.MicroserviceId); ok != false && teamFind == team {
    							continue ResponsibleMssLoop
    						}
    					}
    					teamsDelete = append(teamsDelete, team)
    				}
    			}
    		}
    	}
    	if len(teamsDelete) > 0 {
    		incident.DeleteResponsibles(teamsDelete)
    	}
    }

    Отличное читается код на Golang

    Запостил: prostohz, 09 Октября 2018

    Комментарии (7) RSS

    Добавить комментарий