Skip to content

Commit

Permalink
chore: update readme add some desc for pkg dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jun 12, 2022
1 parent 0d3bc0b commit d0f5830
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ INI data parse by golang. INI config data management tool library.
- Support comments start with `;` `#`
- Complete unit test(coverage > 90%)
- Support variable reference, default compatible with Python's configParser format `%(VAR)s`
- Sub-package `dotenv` that supports importing ENV data from files (eg `.env`)

## More formats

Expand Down Expand Up @@ -249,6 +250,9 @@ val := dotenv.Get("ENV_KEY")
// Or use
// val := os.Getenv("ENV_KEY")

// get int value
intVal := dotenv.Int("LOG_LEVEL")

// with default value
val := dotenv.Get("ENV_KEY", "default value")
```
Expand Down
4 changes: 4 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- 支持使用 `;` `#` 注释一行
- 支持变量参考,默认兼容Python的configParser格式 `%(VAR)s`
- 完善的单元测试(coverage > 90%)
- 子包 `dotenv` - 提供了加载解析 `.env` 文件数据为ENV环境变量

## 更多格式

Expand Down Expand Up @@ -241,6 +242,9 @@ val := dotenv.Get("ENV_KEY")
// Or use
// val := os.Getenv("ENV_KEY")

// get int value
intVal := dotenv.Int("LOG_LEVEL")

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

0 comments on commit d0f5830

Please sign in to comment.