http_test.go 492 B

123456789101112131415161718192021222324
  1. package http
  2. import (
  3. "flag"
  4. "fmt"
  5. "go-common/app/service/openplatform/abtest/conf"
  6. "go-common/app/service/openplatform/abtest/service"
  7. httpx "go-common/library/net/http/blademaster"
  8. _ "github.com/smartystreets/goconvey/convey"
  9. )
  10. var client *httpx.Client
  11. func init() {
  12. flag.Parse()
  13. if err := conf.Init(); err != nil {
  14. panic(fmt.Errorf("conf.Init() error(%v)", err))
  15. }
  16. svr := service.New(conf.Conf)
  17. client = httpx.NewClient(conf.Conf.HTTPClient.Read)
  18. Init(conf.Conf, svr)
  19. }