printer/plainprinter.go
changeset 150 7f46bcaf240c
parent 148 6c763fa86e9a
child 152 4397b8c740e5
equal deleted inserted replaced
149:e2be5743856b 150:7f46bcaf240c
   292 	indentedPrint(w, indent, false, false, "URL", "%s", s.URL)
   292 	indentedPrint(w, indent, false, false, "URL", "%s", s.URL)
   293 	// Display minimum details of attachments
   293 	// Display minimum details of attachments
   294 	//return p.PrintObj(s.MediaAttachments, w, indent+p.Indent)
   294 	//return p.PrintObj(s.MediaAttachments, w, indent+p.Indent)
   295 	for _, a := range s.MediaAttachments {
   295 	for _, a := range s.MediaAttachments {
   296 		indentedPrint(w, indent+p.Indent, true, false, "Attachment ID", "%d", a.ID)
   296 		indentedPrint(w, indent+p.Indent, true, false, "Attachment ID", "%d", a.ID)
   297 		if a.TextURL != "" {
   297 		if a.TextURL != nil && *a.TextURL != "" {
   298 			indentedPrint(w, indent+p.Indent, true, false, "Text URL", "%s", a.TextURL)
   298 			indentedPrint(w, indent+p.Indent, true, false, "Text URL", "%s", *a.TextURL)
   299 		} else if a.URL != "" {
   299 		} else if a.URL != "" {
   300 			indentedPrint(w, indent+p.Indent, false, false, "URL", "%s", a.URL)
   300 			indentedPrint(w, indent+p.Indent, false, false, "URL", "%s", a.URL)
   301 		} else {
   301 		} else if a.RemoteURL != nil {
   302 			indentedPrint(w, indent+p.Indent, false, false, "Remote URL", "%s", a.RemoteURL)
   302 			indentedPrint(w, indent+p.Indent, false, false, "Remote URL", "%s", *a.RemoteURL)
   303 		}
   303 		}
   304 	}
   304 	}
   305 	return nil
   305 	return nil
   306 }
   306 }
   307 
   307