Compare commits

..

3 Commits

Author SHA1 Message Date
9d23ddee6d Update CI to test go 1.20 2023-02-02 11:36:06 +11:00
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
3 changed files with 3 additions and 4 deletions

View File

@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [ '1.19', '1.18', '1.17', '1.16', '1.15' ]
go: [ '1.20', '1.19', '1.18', '1.17', '1.16' ]
os: [ ubuntu-latest, macOS-latest, windows-latest ]
name: ${{ matrix.os }} Go ${{ matrix.go }} Tests
steps:

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
```go
_ = godotenv.Load("somerandomfile")
_ = godotenv.Load("filenumberone.env", "filenumbertwo.env")
godotenv.Load("somerandomfile")
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)

View File

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