From ed1c9ad353ece52fb9f32cce8ec83f2a3faa9998 Mon Sep 17 00:00:00 2001 From: "Norberto A. (GitHub @Limesey)" <41595007+Limesey@users.noreply.github.com> Date: Mon, 10 May 2021 19:37:45 +0100 Subject: [PATCH] Util functions --- src/util.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/util.go diff --git a/src/util.go b/src/util.go new file mode 100644 index 0000000..b395b56 --- /dev/null +++ b/src/util.go @@ -0,0 +1,24 @@ +package main + +import "os" + +func folderExists(folderPath string) bool { + _, err := os.Stat(folderPath) + + return !os.IsNotExist(err) +} + +func createSettings() { + // TO DO: + // Create JSON file with default settings + + type DefaultSettings struct { + AuthenticationCookie string + } +} + +func loadSettings() { + // Check if JSON file exists + // If so, load into struct + // Else, create settings and return +}