from a mysql database. I retrieve the record without a problem here is the
struct below.
type Reseller struct {
Id int64
Name sql.NullString
AppDomain sql.NullString
Installed sql.NullInt64
MarketingType sql.NullString
Bundleurl sql.NullString
Bundlename sql.NullString
BundleType sql.NullString
}
I wanted to write a simple test and I saw that I couldn't access the struct
field directly and I'm curious why? The function below would return "Box
Report for {Dr. XYZ true}" instead of "Box Report for Dr.XYZ"
I played around changed the function to what is below. I'm curious when
does one know to use this syntax?
//Report reports on monthly usage
func (b *Box) Report() string {
var report string
report = fmt.Sprintf("Box Report for %v", b.Reseller.Name.String)
return report
}
Thanks in advanced
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.