<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mirabeau2Code</title>
    <description>The latest articles on DEV Community by Mirabeau2Code (@mirabeau2code).</description>
    <link>https://dev.to/mirabeau2code</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F462207%2F554c3e4a-6e06-4c46-ba9e-ff8476b3a104.png</url>
      <title>DEV Community: Mirabeau2Code</title>
      <link>https://dev.to/mirabeau2code</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mirabeau2code"/>
    <language>en</language>
    <item>
      <title>Convert var string struct key to struct key</title>
      <dc:creator>Mirabeau2Code</dc:creator>
      <pubDate>Wed, 02 Sep 2020 13:02:01 +0000</pubDate>
      <link>https://dev.to/mirabeau2code/convert-var-string-struc-key-to-struct-key-4nfi</link>
      <guid>https://dev.to/mirabeau2code/convert-var-string-struc-key-to-struct-key-4nfi</guid>
      <description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;I have a map (string) of "tag" to convert "words" into a text&lt;br&gt;
this list of "Tags" must be replaced by values coming from a structure&lt;/p&gt;

&lt;p&gt;sample:&lt;br&gt;
&lt;code&gt;var users struc {&lt;br&gt;
         login String&lt;/code&gt;json:" options "&lt;code&gt;&lt;br&gt;
         passwd String&lt;/code&gt;json:" options "&lt;code&gt;&lt;br&gt;
}&lt;br&gt;
var folders struc {&lt;br&gt;
     arch String&lt;/code&gt;json:" folders "&lt;code&gt;&lt;br&gt;
     dest String&lt;/code&gt;json:" folders "`&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;var TAGS = map [string] string {&lt;br&gt;
"{login}": "users.login",&lt;br&gt;
"{passwd}": "users.passwd",&lt;br&gt;
"{archive}": "folders.arch",&lt;br&gt;
"{dest}": "folders.dest",&lt;br&gt;
}`&lt;/p&gt;

&lt;p&gt;To do something like this:&lt;br&gt;
&lt;code&gt;var test = "Name = {login} archive = {archive} destination = {dest} / {login}"&lt;br&gt;
var realTest = ReplaceTag (test, &amp;amp; TAGS)&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
I don't know how to convert the strings from the value to the real value of the structure.&lt;br&gt;
I know how to do it directly but not when it is in the form of a string&lt;/p&gt;

&lt;p&gt;thank you in advance&lt;/p&gt;

</description>
      <category>go</category>
    </item>
  </channel>
</rss>
