Open mosleim opened 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.
sample code:
.env file:
this test will fail.