From 03a8b271dda014767cd05b0e0be0258f5bd1a968 Mon Sep 17 00:00:00 2001 From: Ahmadreza Zibaei Date: Sun, 2 Jun 2019 09:13:26 +0430 Subject: [PATCH] update examples/utilities/mod file --- examples/follow-tag-bot/main.go | 2 +- go.mod | 2 ++ utilities/export.go | 2 ++ utilities/import.go | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/follow-tag-bot/main.go b/examples/follow-tag-bot/main.go index 5f045fce..9b3f888b 100644 --- a/examples/follow-tag-bot/main.go +++ b/examples/follow-tag-bot/main.go @@ -4,7 +4,7 @@ import ( "log" "os" - "github.com/ahmdrz/goinsta" + "github.com/ahmdrz/goinsta/v2" ) func main() { diff --git a/go.mod b/go.mod index 19b47934..72f511e7 100644 --- a/go.mod +++ b/go.mod @@ -1 +1,3 @@ module github.com/ahmdrz/goinsta/v2 + +go 1.12 diff --git a/utilities/export.go b/utilities/export.go index 24af5ec4..79c8c8ee 100644 --- a/utilities/export.go +++ b/utilities/export.go @@ -3,9 +3,11 @@ package utilities import ( "bytes" "encoding/base64" + "github.com/ahmdrz/goinsta" ) +// ExportAsBytes exports selected *Instagram object as []byte func ExportAsBytes(insta *goinsta.Instagram) ([]byte, error) { buffer := &bytes.Buffer{} err := goinsta.Export(insta, buffer) diff --git a/utilities/import.go b/utilities/import.go index 7894c6f8..f0b7556f 100644 --- a/utilities/import.go +++ b/utilities/import.go @@ -3,9 +3,13 @@ package utilities import ( "bytes" "encoding/base64" + "github.com/ahmdrz/goinsta" ) +// ImportFromBytes imports instagram configuration from an array of bytes. +// +// This function does not set proxy automatically. Use SetProxy after this call. func ImportFromBytes(inputBytes []byte) (*goinsta.Instagram, error) { return goinsta.ImportReader(bytes.NewReader(inputBytes)) }