Compare commits

..

2 Commits

Author SHA1 Message Date
cc9e9b7de7 Multiline string support (#156)
* refactor dotenv parser in order to support multi-line variable values declaration

Signed-off-by: x1unix <denis0051@gmail.com>

* Add multi-line var values test case and update comment test

Signed-off-by: x1unix <denis0051@gmail.com>

* Expand fixture tests to include multiline strings

* Update go versions to test against

* Switch to GOINSECURE for power8 CI task

* When tests fail, show source version of string (inc special chars)

* Update parser.go

Co-authored-by: Austin Sasko <austintyler0239@yahoo.com>

* Fix up bad merge

* Add a full fixture for comments for extra piece of mind

* Fix up some lint/staticcheck recommendations

* Test against go 1.19 too

Signed-off-by: x1unix <denis0051@gmail.com>
Co-authored-by: x1unix <denis0051@gmail.com>
Co-authored-by: Austin Sasko <austintyler0239@yahoo.com>
2023-01-27 13:14:16 +11:00
0f21d20acb fix tiny details (#199)
* remove empty line

* remove unnecessary assignments

following commit 2ed25fcb28.
2023-01-27 13:01:43 +11:00
2 changed files with 2 additions and 3 deletions

View File

@ -75,8 +75,8 @@ import _ "github.com/joho/godotenv/autoload"
While `.env` in the project root is the default, you don't have to be constrained, both examples below are 100% legit While `.env` in the project root is the default, you don't have to be constrained, both examples below are 100% legit
```go ```go
_ = godotenv.Load("somerandomfile") godotenv.Load("somerandomfile")
_ = godotenv.Load("filenumberone.env", "filenumbertwo.env") godotenv.Load("filenumberone.env", "filenumbertwo.env")
``` ```
If you want to be really fancy with your env file you can do comments and exports (below is a valid env file) If you want to be really fancy with your env file you can do comments and exports (below is a valid env file)

View File

@ -1,2 +1 @@
export OPTION_A='postgres://localhost:5432/database?sslmode=disable' export OPTION_A='postgres://localhost:5432/database?sslmode=disable'