NewCURL only create a curl

This commit is contained in:
eson 2018-11-27 01:32:49 +08:00
parent 3ab6177286
commit 7b326f3644

View File

@ -1,7 +1,6 @@
package curl2info
import (
"errors"
"fmt"
"io/ioutil"
"log"
@ -28,20 +27,7 @@ type CURL struct {
}
// NewCURL new 一个 curl 出来
func NewCURL(scurl ...string) *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
}
func NewCURL() *CURL {
u := &CURL{}
u.Insecure = false