Optimize code

This commit is contained in:
Wang Guoliang
2018-01-24 13:43:51 +08:00
committed by Ta-Ching Chen
parent 01bcfad44a
commit b578819202
11 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ func waitForCRDs(crdClient *rest.RESTClient) error {
return nil
}
if time.Now().Sub(start) > 30*time.Second {
if time.Since(start) > 30*time.Second {
return errors.New("timeout waiting for CRDs")
}
}
+4 -4
View File
@@ -128,7 +128,7 @@ func functionTests(crdClient *rest.RESTClient) {
if wf.Spec.Environment.Name != function.Spec.Environment.Name {
log.Panicf("Bad object from watch: %#v", wf)
}
log.Printf("watch event took %v", time.Now().Sub(start))
log.Printf("watch event took %v", time.Since(start))
recvd = true
}
@@ -221,7 +221,7 @@ func environmentTests(crdClient *rest.RESTClient) {
if obj.Spec.Runtime.Image != environment.Spec.Runtime.Image {
log.Panicf("Bad object from watch: %#v", obj)
}
log.Printf("watch event took %v", time.Now().Sub(start))
log.Printf("watch event took %v", time.Since(start))
recvd = true
}
@@ -313,7 +313,7 @@ func httpTriggerTests(crdClient *rest.RESTClient) {
if obj.Spec.Method != httpTrigger.Spec.Method {
log.Panicf("Bad object from watch: %#v", obj)
}
log.Printf("watch event took %v", time.Now().Sub(start))
log.Printf("watch event took %v", time.Since(start))
recvd = true
}
@@ -408,7 +408,7 @@ func kubernetesWatchTriggerTests(crdClient *rest.RESTClient) {
if obj.Spec.Type != kubernetesWatchTrigger.Spec.Type {
log.Panicf("Bad object from watch: %#v", obj)
}
log.Printf("watch event took %v", time.Now().Sub(start))
log.Printf("watch event took %v", time.Since(start))
recvd = true
}