Skip to content

Analyzer: helps uncover bugs by reporting a diagnostic for mistakes of using helper functions in the stripe-go library while you need to support multiple api keys.

License

Notifications You must be signed in to change notification settings

jtorvald/vet-global-stripe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vet Global Stripe function calls

While implementing the stripe-go library I needed to implement it using multiple API keys. When you want to use the library with multiple API keys you need to make sure that you use the client instead of the helper functions.

If you're dealing with multiple keys, it is recommended you use client.API. This allows you to create as many clients as needed, each with their own individual key.

-- Stripe: With a Client

Disclaimer

This project is a quick and dirty checker to see if helper functions are used.

  • The implementation is far from perfect.
  • The helper functions are added as a list of strings, and it does not analyze the stripe library for calls to getC() for the default client. Which it should, but I've no idea how to write that logic. If you do: feel free to let me know.

Installation

go install

Usage

go vet -vettool=$(which vet-global-stripe) package

Report

$ go vet -vettool=$(which vet-global-stripe) package
# yourpackage
main.go:50:19: don't use global stripe function: paymentintent.New

LICENSE

MIT Copyright (c) 2021 Jørgen Teunis

About

Analyzer: helps uncover bugs by reporting a diagnostic for mistakes of using helper functions in the stripe-go library while you need to support multiple api keys.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages