Skip to content

Commit

Permalink
Ignore when .env not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
dasbd72 committed Feb 19, 2024
1 parent 1e1c34f commit c403949
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cmd/ccy-cli/balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ import (
"github.com/dasbd72/asset-management/binance"
"github.com/dasbd72/asset-management/max"
"github.com/dasbd72/asset-management/okx"
"github.com/joho/godotenv"
"github.com/spf13/cobra"
)

func Balance(cmd *cobra.Command, args []string) error {
// Load environment variables
ctx := context.Background()
err := godotenv.Load()
if err != nil {
return err
}

totalBalance := 0.0
err = func() error {
err := func() error {
apiKey := os.Getenv("BINANCE_API_KEY")
apiSecret := os.Getenv("BINANCE_API_SECRET")
if apiKey == "" || apiSecret == "" {
Expand Down

0 comments on commit c403949

Please sign in to comment.