From 929214e4dd2d3dcbee9a7b59d712e55730047618 Mon Sep 17 00:00:00 2001 From: atridadl Date: Sun, 7 Jan 2024 14:31:10 -0700 Subject: [PATCH] Cleaned up some possible bugs --- go.mod | 2 +- go.sum | 2 ++ main.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 25e94c3..39fd624 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require github.com/diamondburned/arikawa/v3 v3.3.4 require ( golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect ) require ( diff --git a/go.sum b/go.sum index b2d765e..5509175 100644 --- a/go.sum +++ b/go.sum @@ -33,6 +33,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/main.go b/main.go index 8d61dcb..a28c87a 100644 --- a/main.go +++ b/main.go @@ -235,13 +235,13 @@ func (h *handler) cmdPic(ctx context.Context, data cmdroute.CommandData) *api.In test, ok := prediction.([]interface{}) if !ok { - fmt.Println("prediction is not []interface{}") + return errorResponse(errors.New("prediction is not []interface{}")) } imgUrl, ok := test[0].(string) if !ok { - fmt.Println("prediction.Output[0] is not a string") + return errorResponse(errors.New("prediction.Output[0] is not a string")) } imageRes, imageGetErr := http.Get(imgUrl)