title: Linking my HTML to Go Lang
body: <p>I'm trying to show my result set and Variables from .Go Lang to an HTML Page. </p>
  
  <p><a href="https://i.stack.imgur.com/W0NpM.png" rel="nofollow noreferrer">Assuming this tree view as my workspace.</a>
      <strong>Home.HTML</strong>  </p>
  
  <pre><code> &lt;div id="Golang"&gt;&lt;p&gt;My Name is : &lt;i&gt;{{.myName}}&lt;/i&gt;&lt;/p&gt;&lt;/div&gt;
      &lt;div id="Golang"&gt;&lt;p&gt;Some Random Database Test: &lt;br&gt;{{.Country}} {{.City}} &lt;/p&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>db.Go</strong></p>
  
  <pre><code>package main
  
  import (
      "database/sql"
      "fmt"
      "html/template"
      "log"
      "net/http"
  
      _ "github.com/go-sql-driver/mysql"
  )
  
  type world struct {
      Country sql.NullString `json:"country"`
      State   sql.NullString `json:"state"`
      City    sql.NullString `json:"city"`
      Abbr    string         `json:"abbriviation"`
      id      int            `json:"id"`
      CCode   int            `json:"CountryCode"`
  }
  
  func main() {
  
      name := "Sam"
  
      dsn := "root:1234@tcp(127.0.0.1:3306)/script"
      // Open database
      fmt.Println("We're going to connect a MySql Db")
      db, err := sql.Open("mysql", dsn)
      if err != nil {
          panic(err)
      }
  
      defer db.Close()
  
      fmt.Println("Successfully connected to Mysql Db")
  
      results, err := db.Query("SELECT * FROM CountryDb WHERE Country =?", "India")
      if err != nil {
          panic(err.Error())
      }
  
      for results.Next() {
          var tag world
          err = results.Scan(&amp;tag.Abbr, &amp;tag.Country, &amp;tag.CCode, &amp;tag.State, &amp;tag.City)
          if err != nil {
              panic(err.Error()) 
          }
          log.Printf(tag.Abbr, tag.Country, tag.CCode, tag.State, tag.City)
      }
  
  }
  </code></pre>
  
  <p>Now how can i show values from my Go program to HTML Tags.
  This is my first go program and I'm not much aware of this language. I go through some online tutorials but the way they are written is not very helpful.
  so any help on this would be appreciated.
  Thanks</p>