File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
integration_tests/httpcache Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
"math/rand"
13
13
"runtime"
14
14
"strconv"
15
+ "strings"
15
16
"sync"
16
17
"time"
17
18
@@ -83,23 +84,27 @@ func main() {
83
84
84
85
type query struct {
85
86
status * int
87
+ wait time.Duration
86
88
}
87
89
88
90
func (q * query ) String () string {
89
91
if q == nil {
90
92
return ""
91
93
}
92
94
93
- var s string
95
+ var args [] string
94
96
95
97
if q .status != nil {
96
- if s != "" {
97
- s += "&"
98
- }
99
- s += fmt .Sprintf ("status=%v" , * q .status )
98
+ s := fmt .Sprintf ("status=%v" , * q .status )
99
+ args = append (args , s )
100
+ }
101
+
102
+ if q .wait != 0 {
103
+ s := fmt .Sprintf ("wait=%v" , q .wait .Milliseconds ())
104
+ args = append (args , s )
100
105
}
101
106
102
- return "?" + s
107
+ return "?" + strings . Join ( args , "&" )
103
108
}
104
109
105
110
func getTestReq (method string , q * query , body io.Reader ) * fsthttp.Request {
You can’t perform that action at this time.
0 commit comments