I have my .env file with 2 properties
BOT_TOKEN=rightHereIsWhereMyTokenIs
TEST=1234
when I go run main.go with this code this is my output
env: environment variable "BOT_TOKEN" should not be empty
{BotToken: Test:0}
What am I doing wrong?
package main
import (
"fmt"
"github.com/caarlos0/env/v6"
)
type config struct {
BotToken string `env:"BOT_TOKEN,notEmpty"`
Test int32 `env:"TEST"`
}
func main() {
cfg := config{}
if err := env.Parse(&cfg); err != nil {
fmt.Printf("%+v\n", err)
}
fmt.Printf("%+v\n", cfg)
}
I have my .env file with 2 properties
when I
go run main.gowith this code this is my outputWhat am I doing wrong?