mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-23 21:43:48 +00:00
Merge pull request #1212 from kiyonlin/client-warning
Make client warning once
This commit is contained in:
commit
f0dac0cdcf
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@ -16,3 +16,4 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
- name: Run Test
|
||||
run: go test ./... -v -race
|
||||
|
||||
|
10
client.go
10
client.go
@ -16,9 +16,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/fiber/v2/utils"
|
||||
|
||||
"github.com/gofiber/fiber/v2/internal/encoding/json"
|
||||
"github.com/gofiber/fiber/v2/utils"
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
|
||||
@ -480,7 +479,7 @@ func (a *Agent) JSON(v interface{}) *Agent {
|
||||
return a
|
||||
}
|
||||
|
||||
// XML sends a XML request.
|
||||
// XML sends an XML request.
|
||||
func (a *Agent) XML(v interface{}) *Agent {
|
||||
a.req.Header.SetContentType(MIMEApplicationXML)
|
||||
|
||||
@ -720,10 +719,13 @@ func (a *Agent) Dest(dest []byte) *Agent {
|
||||
}
|
||||
|
||||
/************************** End Agent Setting **************************/
|
||||
var warnOnce sync.Once
|
||||
|
||||
// Bytes returns the status code, bytes body and errors of url.
|
||||
func (a *Agent) Bytes() (code int, body []byte, errs []error) {
|
||||
fmt.Println("[Warning] client is still in beta, API might change in the future!")
|
||||
warnOnce.Do(func() {
|
||||
fmt.Println("[Warning] client is still in beta, API might change in the future!")
|
||||
})
|
||||
|
||||
defer a.release()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user