From b98aab2d0dbf3ee9a8fe314f9510553026b8fe04 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 27 Mar 2019 13:32:24 +0000 Subject: [PATCH] change json lib --- go.mod | 2 +- go.sum | 2 ++ module/apis/google/google.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 678e351..35d8e27 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/go-irc/irc v2.1.0+incompatible github.com/gorilla/sessions v1.1.3 // indirect github.com/jmoiron/sqlx v1.2.0 - github.com/json-iterator/go v1.1.5 // indirect + github.com/json-iterator/go v1.1.6 github.com/lib/pq v1.0.0 github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 // indirect github.com/mattn/go-isatty v0.0.4 // indirect diff --git a/go.sum b/go.sum index 0b52f1b..61a644d 100644 --- a/go.sum +++ b/go.sum @@ -37,6 +37,8 @@ github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= diff --git a/module/apis/google/google.go b/module/apis/google/google.go index 3686666..7004bf3 100644 --- a/module/apis/google/google.go +++ b/module/apis/google/google.go @@ -1,7 +1,6 @@ package google import ( - "encoding/json" "errors" "fmt" "io/ioutil" @@ -10,11 +9,13 @@ import ( "strings" "git.trj.tw/golang/mtfosbot/module/apis" + jsoniter "github.com/json-iterator/go" "git.trj.tw/golang/mtfosbot/module/config" ) var baseURL = "https://www.googleapis.com" +var json = jsoniter.ConfigCompatibleWithStandardLibrary func getURL(p string, querystring ...interface{}) (string, bool) { u, err := url.Parse(baseURL) @@ -94,7 +95,6 @@ func QueryYoutubeName(id string) (n string, err error) { } bodyBytes, err := ioutil.ReadAll(resp.Body) - fmt.Println("show yt resp body :: ", string(bodyBytes)) if err != nil { return "", err }