Skip to content

Commit

Permalink
Change in listContains and getListValues
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalaiselvi84 committed Jan 23, 2024
1 parent 56e4880 commit 8522d9c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/simple-game-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ func listContains(s *sdk.SDK, listName string, value string) (string, error) {
if ok {
return "SUCCESS: " + strconv.FormatBool(ok) + "\n", nil
}
return strconv.FormatBool(ok), nil
return strconv.FormatBool(ok), err
}

// getListLength returns the length (number of values) of the given List as a string
Expand All @@ -822,7 +822,10 @@ func getListValues(s *sdk.SDK, listName string) (string, error) {
log.Printf("Error getting List %s values: %s", listName, err)
return strings.Join(values, ",") + "\n", err
}
return "VALUES: " + strings.Join(values, ",") + "\n", nil
if len(values) > 0 {
return "VALUES: " + strings.Join(values, ",") + "\n", nil
}
return strings.Join(values, ",") + "\n", err
}

// appendListValue returns if the given value was successfuly added to the List (true) or not (false)
Expand Down

0 comments on commit 8522d9c

Please sign in to comment.