19 lines
219 B
Go
19 lines
219 B
Go
|
package restyHttp
|
||
|
|
||
|
import (
|
||
|
"github.com/go-resty/resty/v2"
|
||
|
"sync"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
once sync.Once
|
||
|
client *resty.Client
|
||
|
)
|
||
|
|
||
|
func GetHttpClient() *resty.Client {
|
||
|
once.Do(func() {
|
||
|
client = resty.New()
|
||
|
})
|
||
|
return client
|
||
|
}
|