-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2ca221
commit bca2c15
Showing
6 changed files
with
46 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# IDE Config | ||
.vscode/launch.json | ||
.idea | ||
.idea | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
module github.com/SimplyCodin/bilit/examples/modern | ||
|
||
go 1.12 | ||
|
||
require github.com/SimplyCodin/bilit v0.4.1 | ||
|
||
replace github.com/SimplyCodin/bilit => ../../ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/SimplyCodin/bilit" | ||
) | ||
|
||
func main() { | ||
bilit.Debug = true | ||
|
||
template := bilit.Template("Hello, I'm [{{name}}] from (${City}), {{{from_state}}}") | ||
|
||
dataSrc := map[string]string{ | ||
"name": "John", | ||
"City": "Dallas", | ||
"from_state": "TX", | ||
} | ||
|
||
str := template.Populate(dataSrc) | ||
fmt.Println("[Modern API]", str) | ||
|
||
data := template.Pull(str) | ||
fmt.Println("[Modern API]", data) | ||
} |