Skip to content

Conversation

@itsjetlag
Copy link

This commit fixes the environment loading mechanism by:

  • Removing duplicate .env loading in utils/get_env.go
  • Centralizing all environment loading in main.go
  • Adding better error handling with more descriptive messages
  • Making .env loading non-fatal to support fallback to default values
  • Improving debugging by displaying the working directory

The previous implementation attempted to load the .env file in multiple places, leading to confusing error messages and potential inconsistencies. This change makes the environment loading process more robust and easier to debug when issues occur.

This commit fixes the environment loading mechanism by:
- Removing duplicate .env loading in utils/get_env.go
- Centralizing all environment loading in main.go
- Adding better error handling with more descriptive messages
- Making .env loading non-fatal to support fallback to default values
- Improving debugging by displaying the working directory

The previous implementation attempted to load the .env file in multiple
places, leading to confusing error messages and potential inconsistencies.
This change makes the environment loading process more robust and easier
to debug when issues occur.
@quotexx
Copy link

quotexx commented Mar 21, 2025

I tried the soltuion you gave. But having error loading . env file

@itsjetlag
Copy link
Author

what error did you get? it's working fine on my side @quotexx

@quotexx
Copy link

quotexx commented Mar 21, 2025

image

Here is the problem

@itsjetlag
Copy link
Author

have you created the .env file? @quotexx

@quotexx
Copy link

quotexx commented Mar 22, 2025

Yeah, created it. I also tried deleting the . env file of go then proceed same problem. I tried everything but syill it happens

@KlouzakA
Copy link

@quotexx erase the initial 0x from your private key, it should work

@quotexx
Copy link

quotexx commented Mar 22, 2025

Also did it same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants