From 262737a66dc63545e27551c10c2099b62c5cc972 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Tue, 14 Dec 2021 13:46:45 +0100 Subject: [PATCH] move helper --- helper.go => internal/piwigo/helper.go | 4 ++-- session.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename helper.go => internal/piwigo/helper.go (68%) diff --git a/helper.go b/internal/piwigo/helper.go similarity index 68% rename from helper.go rename to internal/piwigo/helper.go index edaa379..5a24b1d 100644 --- a/helper.go +++ b/internal/piwigo/helper.go @@ -1,11 +1,11 @@ -package main +package piwigo import ( "encoding/json" "fmt" ) -func dumpResponse(v interface{}) (err error) { +func DumpResponse(v interface{}) (err error) { b, err := json.MarshalIndent(v, "", " ") if err == nil { fmt.Println(string(b)) diff --git a/session.go b/session.go index b5c8fb6..4f81b20 100644 --- a/session.go +++ b/session.go @@ -60,7 +60,7 @@ func (c *StatusCommand) Execute(args []string) error { var resp map[string]interface{} Piwigo.Post("pwg.session.getStatus", &url.Values{}, &resp) - dumpResponse(resp) + piwigo.DumpResponse(resp) return nil }