Pass by reference, not value, in for loop
This commit is contained in:
parent
e24a9b1a52
commit
13c5e84d31
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue