Hello
I have a map (string) of "tag" to convert "words" into a text
this list of "Tags" must be replaced by values coming from a structure
sample:
var users struc {
json:" options "
login String
json:" options "
passwd String
json:" folders "
}
var folders struc {
arch String
json:" folders "`
dest String
}
var TAGS = map [string] string {
"{login}": "users.login",
"{passwd}": "users.passwd",
"{archive}": "folders.arch",
"{dest}": "folders.dest",
}`
To do something like this:
var test = "Name = {login} archive = {archive} destination = {dest} / {login}"
var realTest = ReplaceTag (test, & TAGS)
I don't know how to convert the strings from the value to the real value of the structure.
I know how to do it directly but not when it is in the form of a string
thank you in advance
Top comments (0)