Skip to content

Commit

Permalink
chore: update the parser and dotenv README
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Oct 15, 2022
1 parent 6649869 commit e45a2f2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
10 changes: 10 additions & 0 deletions dotenv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

## Install

```bash
go get github.com/gookit/ini/v2/dotenv
```

## Usage

### Load Env
Expand Down Expand Up @@ -37,3 +43,7 @@ blVal := dotenv.Bool("OPEN_DEBUG")
// with default value
val := dotenv.Get("ENV_KEY", "default value")
```

## License

**MIT**
16 changes: 9 additions & 7 deletions parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

This is a parser for parse INI format content to golang data

> parser is ref the project: https://github.com/dombenson/go-ini, Thank you very much
## Feature

- Support parse section, array value.
- Support comments start with `;` `#`
- Support multi line comments `/* .. */`
- Support multi line value with `"""` or `'''`

## TODO
## Install

- [ ] multi line text `'''text'''`
- [ ] inline comments
```bash
go get github.com/gookit/ini/v2/parser
```

## Ref
## Refers

- [go-ini/ini](https://github.com/go-ini/ini) ini parser and config manage
- [dombenson/go-ini](https://github.com/dombenson/go-ini) ini parser and config manage
- [go-ini/ini](https://github.com/go-ini/ini) ini parser and config manage

## License

Expand Down
1 change: 1 addition & 0 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func TestNewSimpled(t *testing.T) {
p.Reset()
err = p.ParseString(iniStr)
is.Nil(err)
is.NotEmpty(p.Comments())

data := p.SimpleData()
dump.P(data, p.Comments())
Expand Down

0 comments on commit e45a2f2

Please sign in to comment.