-
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
fa092d7
commit 637cb81
Showing
4 changed files
with
17 additions
and
13 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
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,2 +0,0 @@ | ||
github.com/SimplyCodin/bilit v0.0.0-20190826050318-5ab9e1694da9 h1:ujak2uXt2JyPxtlDayZKvvaV+mOOrpzecmz1hez00Go= | ||
github.com/SimplyCodin/bilit v0.0.0-20190826050318-5ab9e1694da9/go.mod h1:fUMSmukB2OQxFkWOZG9LpoYogb+IaBdQVQ2uKHzk2gA= | ||
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,17 +1,25 @@ | ||
package main | ||
|
||
import ( | ||
//"encoding/json" | ||
"fmt" | ||
|
||
"github.com/SimplyCodin/bilit" | ||
) | ||
|
||
func main() { | ||
str := bilit.Populate("Hello, I'm {{name}} from {{City}}, {{from_state}}", bilit.Data{ | ||
bilit.Debug = true | ||
const template = "Hello, I'm {{name}} from ${City}, {{from_state}}" | ||
var dataSrc = map[string]string{ | ||
"name": "John", | ||
"City": "Dallas", | ||
"from_state": "TX", | ||
}) | ||
print(str) | ||
popstr := "Hello, I'm John from Dallas, TX" | ||
test := bilit.Pull("Hello, I'm {{name}} from {{City}}, {{from_state}}", popstr) | ||
print(test) | ||
} | ||
|
||
var str = bilit.Populate(template, dataSrc) | ||
fmt.Println(str, "end") | ||
var data = bilit.Pull(template, str) | ||
fmt.Println(data) | ||
// bts, _ := json.Marshal(data) | ||
// fmt.Println(string(bts)) | ||
} |