MCPcopy Create free account
hub / github.com/github/gh-aw / intToReactionString

Function intToReactionString

pkg/workflow/reactions.go:146–155  ·  view source on GitHub ↗

intToReactionString converts an integer to a reaction string. Only 1 (+1) and -1 are valid integer values for reactions.

(v int64)

Source from the content-addressed store, hash-verified

144// intToReactionString converts an integer to a reaction string.
145// Only 1 (+1) and -1 are valid integer values for reactions.
146func 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}

Callers 2

TestIntToReactionStringFunction · 0.85
parseReactionValueFunction · 0.85

Calls 2

getValidReactionsFunction · 0.85
ErrorfMethod · 0.45

Tested by 1

TestIntToReactionStringFunction · 0.68