You simply return from the function
You can't kill a goroutine It needs to finish by itself
you don't. You can't kill goroutines, they can only self-destroy once they return
 Adrian
                          
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Adrian
                          
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  Обсуждают сегодня