fuck go
This commit is contained in:
		
							parent
							
								
									9744128544
								
							
						
					
					
						commit
						4877177010
					
				
							
								
								
									
										2
									
								
								task.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								task.go
									
									
									
									
									
								
							@ -97,8 +97,8 @@ func (task *Task) ExecuteOnPlan() {
 | 
				
			|||||||
	for _, exec := range task.Plan.GetLoopValues() {
 | 
						for _, exec := range task.Plan.GetLoopValues() {
 | 
				
			||||||
		iexec := exec.GetValue().(IExecute)
 | 
							iexec := exec.GetValue().(IExecute)
 | 
				
			||||||
		if iexec.TimeTo() >= 0 {
 | 
							if iexec.TimeTo() >= 0 {
 | 
				
			||||||
			iexec.CalculateTrigger()
 | 
					 | 
				
			||||||
			task.Execute()
 | 
								task.Execute()
 | 
				
			||||||
 | 
								iexec.CalculateTrigger()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										38
									
								
								task_test.go
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								task_test.go
									
									
									
									
									
								
							@ -30,13 +30,37 @@ func TestExecutePlan(t *testing.T) {
 | 
				
			|||||||
	time.Sleep(time.Second * 2)
 | 
						time.Sleep(time.Second * 2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for _, task := range person.Tasks.GetLoopValues() {
 | 
						for _, task := range person.Tasks.GetLoopValues() {
 | 
				
			||||||
		for _, pr := range task.GetValue().(*Task).ExecuteOnPlan() {
 | 
							task.GetValue().(*Task).ExecuteOnPlan()
 | 
				
			||||||
			if pr.OK {
 | 
					 | 
				
			||||||
				log.Println(pr.Response.Content()[0:100])
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				t.Error(pr.Error)
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type C interface {
 | 
				
			||||||
 | 
						Execute()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type A struct {
 | 
				
			||||||
 | 
						C
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (a *A) Execute() {
 | 
				
			||||||
 | 
						log.Println("A")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (a *A) EE() {
 | 
				
			||||||
 | 
						a.Execute()
 | 
				
			||||||
 | 
						a.Execute()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type B struct {
 | 
				
			||||||
 | 
						A
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (b *B) Execute() {
 | 
				
			||||||
 | 
						log.Println("B")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestCase1(t *testing.T) {
 | 
				
			||||||
 | 
						b := B{}
 | 
				
			||||||
 | 
						b.EE()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user