joho / godotenv

A Go port of Ruby's dotenv library (Loads environment variables from .env files)
http://godoc.org/github.com/joho/godotenv
MIT License
8.5k stars 405 forks source link

Cannot read $ character in value #167

Open mosleim opened 2 years ago

mosleim commented 2 years ago

sample code:


package config

import (
    "os"
    "testing"

    "github.com/joho/godotenv"
)

func TestReadEnv(t *testing.T) {
    err := godotenv.Load()
    if err != nil {
        panic(err)
    }
    selamat5malam := "selamat$5malam"
    password := os.Getenv("PASSWORD")
    if password != selamat5malam {
        panic("expected:" + selamat5malam + ",result: " + password)
    }
}

.env file:


PASSWORD="selamat$5malam"

this test will fail.