Skip to content

Commit

Permalink
Added sample code to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aandryashin committed Nov 27, 2016
1 parent 6f7a98e commit da4f1b4
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,25 @@ Library for automatic reloading configuration files based on file system events.

## Using

`import github.com/aandryashin/reloader`
```go
package main

import (
"log"
"time"

"github.com/aandryashin/reloader"
)

func loadConfig() {
//...
}

func main() {
err := reloader.Watch("config", loadConfig, 5*time.Second)
if err != nil {
log.Fatal(err)
}
//...
}
```

0 comments on commit da4f1b4

Please sign in to comment.