From 62e8370999d28cbf785c25ac5e949550d12a027a Mon Sep 17 00:00:00 2001 From: qydysky Date: Sun, 1 Nov 2020 03:26:03 +0800 Subject: [PATCH] 90 --- Get.go => get/Get.go | 5 +++-- get/Get_test.go | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) rename Get.go => get/Get.go (93%) create mode 100644 get/Get_test.go 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(`