You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
531 B
29 lines
531 B
package http |
|
|
|
import ( |
|
"context" |
|
"fmt" |
|
"net/url" |
|
"testing" |
|
) |
|
|
|
func BenchmarkVersion(b *testing.B) { |
|
for i := 0; i < b.N; i++ { |
|
params := url.Values{} |
|
for k, v := range guscs[0].testData { |
|
params.Set(k, v) |
|
} |
|
req, _ := client.NewRequest("GET", _getVersionURL, "127.0.0.1", params) |
|
var res struct { |
|
Code int `json:"code"` |
|
Data struct { |
|
V int `json:"v"` |
|
D interface{} `json:"d"` |
|
} `json:"data"` |
|
} |
|
|
|
if err := client.Do(context.TODO(), req, &res); err != nil { |
|
fmt.Println(err) |
|
} |
|
} |
|
}
|
|
|