Refactor error handling in generatePullRequestNodeID

Simplified error handling by inlining the encoder.Encode call and removing redundant comments for improved code clarity.
This commit is contained in:
Kynan Ware 2025-08-29 14:20:12 -06:00
parent bc1d306c31
commit 5281be467d

View file

@ -191,15 +191,11 @@ func generatePullRequestNodeID(repoID, pullRequestID int64) string {
encoder := msgpack.NewEncoder(&buf)
encoder.UseCompactInts(true)
// Encode the parts
err := encoder.Encode(parts)
if err != nil {
if err := encoder.Encode(parts); err != nil {
panic(err)
}
// Use URL-safe Base64 encoding without padding
encoded := base64.RawURLEncoding.EncodeToString(buf.Bytes())
// Return with the PR_ prefix
return "PR_" + encoded
}