diff --git a/cmd/sncli/main.go b/cmd/sncli/main.go index 495f3c7..6a51ea5 100644 --- a/cmd/sncli/main.go +++ b/cmd/sncli/main.go @@ -4,7 +4,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/jonhadfield/gosn-v2/cache" "os" "sort" "strconv" @@ -12,10 +11,12 @@ import ( "syscall" "time" + gosn "github.com/jonhadfield/gosn-v2" + "github.com/jonhadfield/gosn-v2/cache" + yaml "gopkg.in/yaml.v2" + sncli "github.com/jonhadfield/sn-cli" - "gopkg.in/yaml.v2" - "github.com/jonhadfield/gosn-v2" "github.com/spf13/viper" "github.com/urfave/cli" "golang.org/x/crypto/ssh/terminal" diff --git a/cmd/sncli/note.go b/cmd/sncli/note.go index 9839bba..fdaa826 100644 --- a/cmd/sncli/note.go +++ b/cmd/sncli/note.go @@ -4,14 +4,15 @@ import ( "encoding/json" "errors" "fmt" + "strconv" + "strings" + "github.com/divan/num2words" - "github.com/jonhadfield/gosn-v2" + gosn "github.com/jonhadfield/gosn-v2" "github.com/jonhadfield/gosn-v2/cache" sncli "github.com/jonhadfield/sn-cli" "github.com/urfave/cli" - "gopkg.in/yaml.v3" - "strconv" - "strings" + yaml "gopkg.in/yaml.v2" ) func processGetNotes(c *cli.Context, opts configOptsOutput) (msg string, err error) { diff --git a/cmd/sncli/session.go b/cmd/sncli/session.go index 6bc2d34..7bf18a1 100644 --- a/cmd/sncli/session.go +++ b/cmd/sncli/session.go @@ -1,9 +1,10 @@ package main import ( - "github.com/jonhadfield/gosn-v2" - "github.com/urfave/cli" "os" + + gosn "github.com/jonhadfield/gosn-v2" + "github.com/urfave/cli" ) func processSession(c *cli.Context, opts configOptsOutput) (msg string, err error) { diff --git a/cmd/sncli/tag.go b/cmd/sncli/tag.go index 17832a1..9c58ec6 100644 --- a/cmd/sncli/tag.go +++ b/cmd/sncli/tag.go @@ -4,13 +4,14 @@ import ( "encoding/json" "errors" "fmt" - "github.com/jonhadfield/gosn-v2" + "strconv" + "strings" + + gosn "github.com/jonhadfield/gosn-v2" "github.com/jonhadfield/gosn-v2/cache" sncli "github.com/jonhadfield/sn-cli" "github.com/urfave/cli" - "gopkg.in/yaml.v3" - "strconv" - "strings" + yaml "gopkg.in/yaml.v2" ) func processGetTags(c *cli.Context, opts configOptsOutput) (msg string, err error) { diff --git a/export.go b/export.go index 4a3a465..ba16c62 100644 --- a/export.go +++ b/export.go @@ -90,10 +90,7 @@ func (i *ImportConfig) Run() error { var encFinalList gosn.EncryptedItems - // only items with uuids that don't yet exist will be imported - for _, itemToImport := range encItemsToImport { - encFinalList = append(encFinalList, itemToImport) - } + encFinalList = append(encFinalList, encItemsToImport...) if len(encFinalList) == 0 { return fmt.Errorf("no items to import were loaded") diff --git a/note_test.go b/note_test.go index f3700bb..2b64c49 100644 --- a/note_test.go +++ b/note_test.go @@ -2,11 +2,12 @@ package sncli import ( "fmt" - "github.com/jonhadfield/gosn-v2/cache" "os" "testing" - "github.com/jonhadfield/gosn-v2" + gosn "github.com/jonhadfield/gosn-v2" + "github.com/jonhadfield/gosn-v2/cache" + "github.com/stretchr/testify/assert" ) diff --git a/tag.go b/tag.go index 73574bd..b15b413 100644 --- a/tag.go +++ b/tag.go @@ -214,7 +214,7 @@ func (input *AddTagsInput) Run() (output AddTagsOutput, err error) { return } - return + return output, err } func (input *GetTagConfig) Run() (items gosn.Items, err error) { @@ -250,7 +250,7 @@ func (input *GetTagConfig) Run() (items gosn.Items, err error) { items.Filter(input.Filters) - return + return items, err } func (input *DeleteTagConfig) Run() (noDeleted int, err error) { diff --git a/tag_test.go b/tag_test.go index 0591e72..f979232 100644 --- a/tag_test.go +++ b/tag_test.go @@ -1,10 +1,11 @@ package sncli import ( - "github.com/jonhadfield/gosn-v2" + "testing" + + gosn "github.com/jonhadfield/gosn-v2" "github.com/jonhadfield/gosn-v2/cache" "github.com/stretchr/testify/assert" - "testing" ) func TestAddDeleteTagByTitle(t *testing.T) {