Skip to content

Commit

Permalink
Fix code formatting in readme (#14)
Browse files Browse the repository at this point in the history
* Add tests for ReadConfig (#11)

* Add tests for ReadConfig

* Fix typos in godoc

* Fix code formatting in readme. Close #12
  • Loading branch information
ilyakaznacheev authored Dec 5, 2019
1 parent a66d761 commit dc1dbed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ if err != nil {

Some environment variables may change during the application run. To get the new values you need to mark these variables as updatable with the tag `env-upd` and then run the update function:

```go
```go
import github.com/ilyakaznacheev/cleanenv

type ConfigRemote struct {
Port string `env:"PORT" env-upd`
Port string `env:"PORT" env-upd`
Host string `env:"HOST" env-upd`
UserName string `env:"USERNAME"`
}
Expand Down Expand Up @@ -209,7 +209,7 @@ type Config struct {
func (c *Config) Update() error {
newField, err := SomeCustomUpdate()
f.Field = newField
return err
return err
}
```

Expand All @@ -226,8 +226,8 @@ There are several most popular config file formats supported:

```go
type Config struct {
Port string `yml:"port" env:"PORT" env-default:"8080"`
Host string `yml:"host" env:"HOST" env-default:"localhost"`
Port string `yml:"port" env:"PORT" env-default:"8080"`
Host string `yml:"host" env:"HOST" env-default:"localhost"`
}

var cfg Config
Expand Down

0 comments on commit dc1dbed

Please sign in to comment.