From 13c5e84d315b88b09ec02e3c89d32e12eaf203ec Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Sun, 29 Mar 2020 22:18:59 -0500 Subject: [PATCH] Pass by reference, not value, in for loop --- factorio-site.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/factorio-site.go b/factorio-site.go index cf110f2..a05448e 100644 --- a/factorio-site.go +++ b/factorio-site.go @@ -72,8 +72,8 @@ func main() { fmt.Printf("Error parsing HTML template: %v\n", err) } - for _, s := range config.Servers { - s.rconConnection, err = rcon.Dial(fmt.Sprintf("%v:%v", s.Host, s.RCONPort), s.RCONPassword) + for i := range config.Servers { + config.Servers[i].rconConnection, err = rcon.Dial(fmt.Sprintf("%v:%v", s.Host, s.RCONPort), s.RCONPassword) if err != nil { log.Fatalf("Error making RCON connection to %v: %v", s.Title, err) }