From 40f8a1cc37f210c3b3a66d2aeee9ccd53862a4ec Mon Sep 17 00:00:00 2001 From: Aykhan Shahsuvarov Date: Sun, 22 Dec 2024 23:15:10 +0400 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Return=20empty=20brackets=20?= =?UTF-8?q?instead=20of=20null=20when=20slice=20length=20is=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/convert.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/convert.go b/utils/convert.go index 76bf424..21e7a92 100644 --- a/utils/convert.go +++ b/utils/convert.go @@ -17,6 +17,9 @@ func (t TruncatedMarshaller) MarshalJSON() ([]byte, error) { if val.Kind() != reflect.Slice && val.Kind() != reflect.Array { return json.Marshal(t.Value) } + if val.Len() == 0 { + return []byte("[]"), nil + } length := val.Len() if length <= t.MaxItems { From f1521cbb74db6385ea3fe6e101c53c78b5c906f3 Mon Sep 17 00:00:00 2001 From: Aykhan Shahsuvarov Date: Mon, 23 Dec 2024 18:58:22 +0400 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=92=84=20Update=20config=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 1927fe7..c8a4be0 100644 --- a/config/config.go +++ b/config/config.go @@ -79,7 +79,7 @@ func (config *RequestConfig) Print() { t.AppendSeparator() t.AppendRow(table.Row{"Cookies", string(utils.PrettyJSONMarshal(config.Cookies, 3, "", " "))}) t.AppendSeparator() - t.AppendRow(table.Row{"Proxies Count", string(utils.PrettyJSONMarshal(config.Proxies, 3, "", " "))}) + t.AppendRow(table.Row{"Proxies", string(utils.PrettyJSONMarshal(config.Proxies, 3, "", " "))}) t.AppendSeparator() t.AppendRow(table.Row{"Proxy Check", !config.NoProxyCheck}) t.AppendSeparator()