From 6f3f3e1d8f2e5da187a7c27136a782fec0669954 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Fri, 28 Oct 2022 15:27:57 +0300 Subject: [PATCH] add json method to gameUtils --- gameUtils/gameUtils.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gameUtils/gameUtils.go b/gameUtils/gameUtils.go index b92cda2..d3be5bb 100644 --- a/gameUtils/gameUtils.go +++ b/gameUtils/gameUtils.go @@ -1,5 +1,9 @@ package gameUtils +import ( + "encoding/json" +) + func FindGameByID(id string, list Games) SteamGame { for _, game := range list.SteamGames { if game.GameId == id { @@ -29,3 +33,9 @@ func GetJSGameInterface(game SteamGame) JSGameInterface { } return newInterface } + +func ConvertServerGamesToJSON(g Games) []byte { + g_json, err := json.Marshal(g) + _ = err //TODO: Check Errors + return g_json +}