Golang Web service not reading env variables on onrender

I deployed a Web service using Go, I’ve set the environment variables needed but my deployment keeps failing due to err from not reading env variables, P.S: the code works fine locally and is able to local envrionment varialbes.

I calll this function in my main.go, I cross-checked everything and couldn’t find an help…

func LoadEnv(){
    err := godotenv.Load()

	if err != nil{
		log.Fatal("failed to load environment variables")

Hi Amadi,

To avoid duplicating efforts, we’ll respond to the ticket you opened about this and close this topic.



This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.