title: How to update a go template while still persisting the original template variables
body: <p>This is a high level question, as I'm not sure how to approach this problem:</p>
  
  <p>I'm building a CLI that sets up code projects for users automatically. </p>
  
  <p>I want to create an <code>update</code> feature that will allow the user to update to the latest CLI's template versions but still keep the original variables they used to create the project (i.e. project name, env variables, etc...)</p>
  
  <p>I know how to create new templates, but I don't know how I could update and still keep the variables passed by the user. </p>
  
  <p>It would be something similar to a git merge, so merge the user's local project with the updated CLI template.</p>
  
  <p>In the code below you can see an example of how the files are templated with <code>var deploymentYamlData</code> as string variables</p>
  
  <p>I have a function that organizes all these file templates into the proper directory structure for the project.</p>
  
  <p>How would I go about merging directory templates with the user's local directory, while being able to persist the original template variables?</p>
  
  <p>Apologies ahead of time if I need to clarify more.</p>
  
  <pre><code>package main
  
  import (
      "text/template"
          "os"
  )
  
  var deploymentYamlData = `---
  
    # do not edit commented lines
    # CLI-Version: {{ .GitTagVersion}}
  
    app: {{ .BotName }}
    type: web
    team: {{ .TeamName }}
    docker_image: {{ .DockerImageName }}
    docker_tag: {{ .TagVersion }}
    internal: false
    replicas: {{ .Replicas }}
    revisionHistoryLimit: 5
    container_port: {{ .DockerImagePort }}
     healthcheck:
      path: /{{ .DockerImageHealthCheck }}
    dynamodb:
      enable_deleteitem: true
      tables:
        - name: {{ .BotName }}_conversation_data
  `
  
  type DigitalAssistant struct {
      BotName string
      TeamName string
      DockerImageName string
      TagVersion string
      Replicas int
      DockerImagePort int
      DockerImageHealthCheck string
          GitTageVersion string
  
  }
  
  func main() {
      bot := DigitalAssistant{"bobisyouruncle", "teamAwesome", "awesomebotimagename", "0.1.0", 1, 8000, "health"}
      bmap, err := template.New("captain.tmpl").Parse(deploymentYamlData)
      if err != nil { panic(err) }
      err = bmap.Execute(os.Stdout, bot)
      if err != nil { panic(err) }
  }
  
  </code></pre>