Skip to content

Commit

Permalink
Chore: remove godotenv
Browse files Browse the repository at this point in the history
it should not be a part of this project
  • Loading branch information
pilinux committed Jan 2, 2023
1 parent cd173c7 commit 959f196
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 45 deletions.
9 changes: 0 additions & 9 deletions env.go

This file was deleted.

5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ module github.com/pilinux/stripego

go 1.19

require (
github.com/joho/godotenv v1.4.0
github.com/stripe/stripe-go/v74 v74.4.0
)
require github.com/stripe/stripe-go/v74 v74.4.0
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg=
github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
16 changes: 2 additions & 14 deletions paymentintent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,8 @@ var PaymentIntentID string
var PaymentIntentAmount int64

func TestCreatePaymentIntent(t *testing.T) {
stripeSK, ok := os.LookupEnv("STRIPE_SK")
if !ok {
err := stripego.Env()
if err != nil {
t.Errorf("failed to load .env: %v", err)
return
}

StripeSK = strings.TrimSpace(os.Getenv("STRIPE_SK"))
Currency = strings.TrimSpace(os.Getenv("CURRENCY"))
} else {
StripeSK = strings.TrimSpace(stripeSK)
Currency = strings.TrimSpace(os.Getenv("CURRENCY"))
}
StripeSK = strings.TrimSpace(os.Getenv("STRIPE_SK"))
Currency = strings.TrimSpace(os.Getenv("CURRENCY"))

PaymentIntentObject = "payment_intent"
PaymentIntentAmount = 1000
Expand Down
19 changes: 3 additions & 16 deletions transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,9 @@ var TransferObject string
var TransferAmount int64

func TestTransferBalance(t *testing.T) {
stripeSK, ok := os.LookupEnv("STRIPE_SK")
if !ok {
err := stripego.Env()
if err != nil {
t.Errorf("failed to load .env: %v", err)
return
}

StripeSK = strings.TrimSpace(os.Getenv("STRIPE_SK"))
Currency = strings.TrimSpace(os.Getenv("CURRENCY"))
Destination = strings.TrimSpace(os.Getenv("DESTINATION"))
} else {
StripeSK = strings.TrimSpace(stripeSK)
Currency = strings.TrimSpace(os.Getenv("CURRENCY"))
Destination = strings.TrimSpace(os.Getenv("DESTINATION"))
}
StripeSK = strings.TrimSpace(os.Getenv("STRIPE_SK"))
Currency = strings.TrimSpace(os.Getenv("CURRENCY"))
Destination = strings.TrimSpace(os.Getenv("DESTINATION"))

TransferObject = "transfer"
TransferAmount = 100
Expand Down

0 comments on commit 959f196

Please sign in to comment.