From: qydysky Date: Sat, 31 Oct 2020 19:26:03 +0000 (+0800) Subject: 90 X-Git-Tag: v0.1.8 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=62e8370999d28cbf785c25ac5e949550d12a027a;p=part%2F.git 90 --- diff --git a/Get.go b/get/Get.go similarity index 93% rename from Get.go rename to get/Get.go index 8e32842..3b5ee96 100644 --- a/Get.go +++ b/get/Get.go @@ -3,6 +3,7 @@ package part import ( "strings" "errors" + p "github.com/qydysky/part" ) type get struct { @@ -12,12 +13,12 @@ type get struct { Err error } -func Get(r Rval) (o *get){ +func Get(r p.Rval) (o *get){ o = new(get) if r.Url == "" {o.Err = errors.New("url == nil");return} - R := Req() + R := p.Req() o.Err = R.Reqf(r) (*o).body = R.Respon diff --git a/get/Get_test.go b/get/Get_test.go new file mode 100644 index 0000000..e1a5a38 --- /dev/null +++ b/get/Get_test.go @@ -0,0 +1,17 @@ +package part + +import ( + "testing" + p "github.com/qydysky/part" +) + +func Test_get(t *testing.T) { + g := Get(p.Rval{ + Url:"https://www.baidu.com/", + }) + g.S(`