#khalid-go-import

1 messages ยท Page 1 of 1 (latest)

odd lilyBOT
inner thistle
#

Hello! Can you provide more details? What does "doesn't work for me" mean? Are you getting an error? Is it running but you're getting an unexpected result? Something else?

civic nimbus
#

I'm sorry, I should have said that go is saying it doesn't exist
could not import github.com/stripe/stripe-go/v74/client (no required module provides package "github.com/stripe/stripe-go/v74/client")

inner thistle
#

Ah, maybe you're using a Go workspace and you need to use go work use?

civic nimbus
#

no, its a standard go project, I can provide my go mod if it helps

inner thistle
#

Let me see if I can find someone better at Go than I am, one sec... ๐Ÿ™‚

civic nimbus
#

thank you

ashen radish
#

khalid-go-import

#

@civic nimbus have you used stripe-go before?

#

Like the code you pasted is not "real code" you have to replace $Resource$ for example

civic nimbus
#

yes, I've been working with it for at least 6 months now

#

that code for $resource could be Customer Subscription etc

ashen radish
#

which version of stripe-go are you using exactly right now?

civic nimbus
#

the same one in the link v74.30.0

#

basically I have customers on an old stripe account I want to create new accounts for. I figured using the client api I would be able to do it

#

I installed doing go get -u github.com/stripe/stripe-go/v74 months ago

ashen radish
#

Okay then I tried ```package main

import (
"fmt"

"github.com/stripe/stripe-go/v74"
"github.com/stripe/stripe-go/v74/client"

)

func main() {
sc := &client.API{}
sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)

params := &stripe.CustomerParams{
    Email: stripe.String("test@example.com"),
}
cus, _ := sc.Customers.New(params)

fmt.Printf("Got: \n", cus)

}

civic nimbus
#

how did you install it? checking my vendor the package doesn't exist

ashen radish
#

I don't know what that last sentence means. What are you checking? And I just did go get -u github.com/stripe/stripe-go/v74 to get your version since I had 76 installed before

civic nimbus
#

hmmm I will close this ticket since now I know this has nothing to do with stripe itself. Thank you

ashen radish
#

I mean it might still be related

#

Can you try my exact go file above?

civic nimbus
#

yes that worked

#

so its my project configuration. Thank you again

ashen radish
#

sure thing!

#

Sorry I understand 20% of go imports myself so always struggle a bit to debug this past simple examples too ๐Ÿ˜ฆ