Skip to content

Commit

Permalink
up(test): add test on go1.18, rm test on go < 1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Apr 15, 2022
1 parent 913e14e commit d0851e3
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go_version: [1.13, 1.14, 1.15, 1.16]
go_version: [1.15, 1.16, 1.17, 1.18]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
go: [1.15]
go: [1.17]

steps:
- name: Checkout
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,24 @@ cfg.WithOptions(ini.ParseEnv,ini.ParseVar, func (opts *Options) {
})
```

## Dotenv

Package `dotenv` that supports importing data from files (eg `.env`) to ENV

### Usage

```go
err := dotenv.Load("./", ".env")
// err := dotenv.LoadExists("./", ".env")

val := dotenv.Get("ENV_KEY")
// Or use
// val := os.Getenv("ENV_KEY")

// with default value
val := dotenv.Get("ENV_KEY", "default value")
```

## Tests

- go tests with cover
Expand Down
18 changes: 18 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,24 @@ cfg.WithOptions(ini.ParseEnv,ini.ParseVar, func (opts *Options) {
})
```

## Dotenv

Package `dotenv` that supports importing data from files (eg `.env`) to ENV

### 使用说明

```go
err := dotenv.Load("./", ".env")
// err := dotenv.LoadExists("./", ".env")

val := dotenv.Get("ENV_KEY")
// Or use
// val := os.Getenv("ENV_KEY")

// with default value
val := dotenv.Get("ENV_KEY", "default value")
```

## 测试

- 测试并输出覆盖率
Expand Down
2 changes: 2 additions & 0 deletions dotenv/testdata/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# comments
DONT_ENV_TEST="blog"
2 changes: 0 additions & 2 deletions dotnev/testdata/.env

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gookit/ini/v2

go 1.13
go 1.15

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down

0 comments on commit d0851e3

Please sign in to comment.