From 0a6b37ccabd4543d6085a00a482bb42beae6ab80 Mon Sep 17 00:00:00 2001 From: Samuel Walker Date: Thu, 24 Oct 2024 15:49:14 -0600 Subject: [PATCH] fixed formatting --- fclauncher/app.go | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/fclauncher/app.go b/fclauncher/app.go index 9ee15fe..d78c485 100644 --- a/fclauncher/app.go +++ b/fclauncher/app.go @@ -2,10 +2,10 @@ package main import ( "context" + "encoding/json" "fmt" "io" "net/http" - "encoding/json" ) // App struct @@ -14,9 +14,9 @@ type App struct { } type Modpack struct { - Name string - Nd string - Last_updated string + Name string + Nd string + Last_updated string } // NewApp creates a new App application struct @@ -36,23 +36,23 @@ func (a *App) Greet(name string) string { } func (a *App) GetModpacks() []string { - res, err := http.Get("https://gitea.piwalker.net/fclauncher/modpacks.json") - if err != nil { - fmt.Println(err.Error()) - } - defer res.Body.Close() - body , err := io.ReadAll(res.Body) - var modpacks []Modpack - err = json.Unmarshal([]byte(body), &modpacks) - if err != nil { - fmt.Println(err.Error()) - return nil - } - var names []string - for _, pack := range modpacks { - names = append(names, pack.Name) - } - return names + res, err := http.Get("https://gitea.piwalker.net/fclauncher/modpacks.json") + if err != nil { + fmt.Println(err.Error()) + } + defer res.Body.Close() + body, err := io.ReadAll(res.Body) + var modpacks []Modpack + err = json.Unmarshal([]byte(body), &modpacks) + if err != nil { + fmt.Println(err.Error()) + return nil + } + var names []string + for _, pack := range modpacks { + names = append(names, pack.Name) + } + return names } func (a *App) CheckPrerequisites() {