text/template golang to string

package main

import (
    "os"
    "text/template"
)

type Person struct {
    Name string
    Age  int
}

func main() {
    // Define a template string
    tmplStr := "Name: {{.Name}}, Age: {{.Age}}"

    // Parse the template
    tmpl, err := template.New("person").Parse(tmplStr)
    if err != nil {
        panic(err)
    }

    // Create a Person object with data
    person := Person{Name: "John Doe", Age: 30}

    // Execute the template and write the output to a string
    var resultString string
    err = tmpl.Execute(os.Stdout, person)
    if err != nil {
        panic(err)
    }
}