(ctx context.Context, comments []*drive.Comment)
| 221 | } |
| 222 | |
| 223 | func printExpandedCommentTable(ctx context.Context, comments []*drive.Comment) { |
| 224 | w, flush := tableWriter(ctx) |
| 225 | defer flush() |
| 226 | fmt.Fprintln(w, "TYPE\tID\tAUTHOR\tQUOTED\tCONTENT\tCREATED\tRESOLVED\tACTION") |
| 227 | for _, comment := range comments { |
| 228 | if comment == nil { |
| 229 | continue |
| 230 | } |
| 231 | author := "" |
| 232 | if comment.Author != nil { |
| 233 | author = comment.Author.DisplayName |
| 234 | } |
| 235 | quoted := "" |
| 236 | if comment.QuotedFileContent != nil { |
| 237 | quoted = truncateString(oneLineTSV(comment.QuotedFileContent.Value), 30) |
| 238 | } |
| 239 | fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%t\t%s\n", |
| 240 | "comment", |
| 241 | comment.Id, |
| 242 | oneLineTSV(author), |
| 243 | quoted, |
| 244 | truncateString(oneLineTSV(comment.Content), 50), |
| 245 | formatDateTime(comment.CreatedTime), |
| 246 | comment.Resolved, |
| 247 | "", |
| 248 | ) |
| 249 | for _, reply := range comment.Replies { |
| 250 | if reply == nil { |
| 251 | continue |
| 252 | } |
| 253 | author = "" |
| 254 | if reply.Author != nil { |
| 255 | author = reply.Author.DisplayName |
| 256 | } |
| 257 | fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", |
| 258 | "reply", |
| 259 | reply.Id, |
| 260 | oneLineTSV(author), |
| 261 | "", |
| 262 | truncateString(oneLineTSV(reply.Content), 50), |
| 263 | formatDateTime(reply.CreatedTime), |
| 264 | "", |
| 265 | oneLineTSV(reply.Action), |
| 266 | ) |
| 267 | } |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | func printCompactCommentTable(ctx context.Context, comments []*drive.Comment, includeQuoted bool) { |
| 272 | w, flush := tableWriter(ctx) |
no test coverage detected