INNER CODE UNIT · Go
buildProductMap
theopenlane/core · cmd/catalog/main.go:256
func buildProductMap(ctx context.Context, sc stripeClient) (map[string]*stripe.Product, error) {
products, err := sc.ListProducts(ctx)
if err != nil {
return nil, err
}
prodMap := map[string]*stripe.Product{}
for _, p := range products {
if p.ID != "" {
prodMap[p.ID] = p
}
if p.Name != "" {
prodMap[p.Name] = p
}
}