intToReactionString converts an integer to a reaction string. Only 1 (+1) and -1 are valid integer values for reactions.
(v int64)
| 144 | // intToReactionString converts an integer to a reaction string. |
| 145 | // Only 1 (+1) and -1 are valid integer values for reactions. |
| 146 | func intToReactionString(v int64) (string, error) { |
| 147 | switch v { |
| 148 | case 1: |
| 149 | return "+1", nil |
| 150 | case -1: |
| 151 | return "-1", nil |
| 152 | default: |
| 153 | return "", fmt.Errorf("invalid reaction value '%d': must be one of %v", v, getValidReactions()) |
| 154 | } |
| 155 | } |