NewCURL only create a curl
This commit is contained in:
parent
3ab6177286
commit
7b326f3644
@ -1,7 +1,6 @@
|
|||||||
package curl2info
|
package curl2info
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
@ -28,20 +27,7 @@ type CURL struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewCURL new 一个 curl 出来
|
// NewCURL new 一个 curl 出来
|
||||||
func NewCURL(scurl ...string) *CURL {
|
func NewCURL() *CURL {
|
||||||
|
|
||||||
if len(scurl) != 0 {
|
|
||||||
if len(scurl) > 1 {
|
|
||||||
panic(errors.New("NewCURL only accept one curl info"))
|
|
||||||
}
|
|
||||||
|
|
||||||
curl, err := ParseRawCURL(scurl[0])
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
return curl
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
u := &CURL{}
|
u := &CURL{}
|
||||||
u.Insecure = false
|
u.Insecure = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user