title: Keep running a second function in the background in Go
body: <p>I want to keep running a Function in the background while the program execute.</p>
  <pre><code>func sendTicket(userTickets uint, firstName string, lastName string, email string) {
      time.Sleep(20 * time.Second) //Simulate email delay
      var ticket = fmt.Sprintf(&quot;%v tickets for %v %v&quot;, userTickets, firstName, lastName)
      fmt.Println(&quot;\n&quot;)
      fmt.Println(&quot;*******************************************************&quot;)
      fmt.Printf(&quot;Sending Ticket:\n %v \nto email address %v\n &quot;, ticket, email)
      fmt.Println(&quot;*******************************************************&quot;)
  }
  </code></pre>
  <p>This is the function I want to keep running in the background. As it has a 20 second wait time, I want this function print out the message while the other functions are running.</p>