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:
parent
bc1d306c31
commit
5281be467d
1 changed files with 1 additions and 5 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue