From 1832d06382b4d503da2769280f2fd784cf83031a Mon Sep 17 00:00:00 2001 From: Andreas Schulte Date: Mon, 23 Oct 2023 23:36:22 +0200 Subject: [PATCH] removed unnecessary type --- jsondb.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jsondb.go b/jsondb.go index 036017b..051e723 100644 --- a/jsondb.go +++ b/jsondb.go @@ -13,8 +13,7 @@ import ( ) type Cluster map[string]Database -type Database map[string]DatabaseValue -type DatabaseValue interface{} +type Database map[string]interface{} var cluster Cluster = Cluster{} var locationOfCluster string = utils.GetPathToParrentFolderOfThisExecutable() @@ -83,7 +82,7 @@ func GetDatabase(name string) (Database, error) { } // GetKeyFromDatabase returns a key from a database if both exist -func GetKeyFromDatabase(nameOfDatabase string, key string) (DatabaseValue, error) { +func GetKeyFromDatabase(nameOfDatabase string, key string) (interface{}, error) { database, databaseExists := cluster[nameOfDatabase] if !databaseExists { return nil, errors.New("database does not exist") @@ -219,7 +218,7 @@ func SetDatabase(name string, database Database) error { } // SetKeyInDatabase sets a key from in a database and write it to file -func SetKeyInDatabase(nameOfDatabase string, key string, value DatabaseValue) error { +func SetKeyInDatabase(nameOfDatabase string, key string, value interface{}) error { err := ReloadDatabase(nameOfDatabase) if err != nil { return err