Skip to content

Commit

Permalink
Fix indenting
Browse files Browse the repository at this point in the history
  • Loading branch information
natekfl committed Jul 7, 2022
1 parent a8393ee commit 8bb4815
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ This is a simple helper to extract values from a string based on a template patt
## Examples

```go
untemplater1, _ := untemplate.Create("/{year}/{month}/{day}/{title}.html")
result1, _ := untemplater1.Extract("/2012/08/12/test.html")
//result1 > map[string]string{"day":"12", "month":"08", "title":"test", "year":"2012"}
untemplater1, _ := untemplate.Create("/{year}/{month}/{day}/{title}.html")
result1, _ := untemplater1.Extract("/2012/08/12/test.html")
//result1 > map[string]string{"day":"12", "month":"08", "title":"test", "year":"2012"}

untemplater2, _ := untemplate.Create("{name} <{email}> ({url})")
result2, _ := untemplater2.Extract("John Doe <[email protected]> (http://example.com)")
//result2 > map[string]string{"email":"[email protected]", "name":"John Doe", "url":"http://example.com"}
untemplater2, _ := untemplate.Create("{name} <{email}> ({url})")
result2, _ := untemplater2.Extract("John Doe <[email protected]> (http://example.com)")
//result2 > map[string]string{"email":"[email protected]", "name":"John Doe", "url":"http://example.com"}

untemplater3, _ := untemplate.Create("Convert {quantity} {from_unit} to {to_unit}")
result3, _ := untemplater3.Extract("Convert 1500 Grams to Kilograms")
//result3 > map[string]string{"from_unit":"Grams", "quantity":"1500", "to_unit":"Kilograms"}
untemplater3, _ := untemplate.Create("Convert {quantity} {from_unit} to {to_unit}")
result3, _ := untemplater3.Extract("Convert 1500 Grams to Kilograms")
//result3 > map[string]string{"from_unit":"Grams", "quantity":"1500", "to_unit":"Kilograms"}
```

## Installation
Expand Down

0 comments on commit 8bb4815

Please sign in to comment.