26 lines
647 B
Go
26 lines
647 B
Go
|
package utils
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
"testing"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type TestCase struct {
|
||
|
Debug bool `default:"false"`
|
||
|
HttpTransport *http.Transport `default:""`
|
||
|
Transport http.RoundTripper `default:""`
|
||
|
GoRoutinePoolSize int `default:"5"`
|
||
|
UserAgent string `default:""`
|
||
|
Scheme string `default:"HTTP"`
|
||
|
Haha uintptr `default:"232"`
|
||
|
Timeout time.Duration `default:"5"`
|
||
|
}
|
||
|
|
||
|
func TestInitStructWithDefaultTag(t *testing.T) {
|
||
|
testcase := &TestCase{}
|
||
|
InitStructWithDefaultTag(testcase)
|
||
|
fmt.Printf("%+v", testcase)
|
||
|
}
|