Add Stripe and HTTP client snippets to Go UltiSnips#52
Merged
Conversation
Adds htclient, sclient, serr, jdec, smain, and idem snippets for common Stripe API and HTTP client patterns. Skipped the new ctx snippet as ctxto already covers context.WithTimeout. https://claude.ai/code/session_0175T5PwVBu493YWDc2jsLhY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a collection of UltiSnips for common Go patterns when working with Stripe and HTTP clients.
Changes:
htclient— HTTP client initialization with configurable timeoutsclient— Stripe client setup from environment variableserr— Stripe error handling with type assertion and error code switchingjdec— JSON response body decoding with error handlingsmain— Main function with STRIPE_SECRET_KEY validationidem— Stripe idempotency key generationThese snippets reduce boilerplate when integrating Stripe payments or making HTTP requests in Go projects. Trigger with
<C-e>and jump between placeholders with<C-j>/<C-k>.https://claude.ai/code/session_0175T5PwVBu493YWDc2jsLhY