writeTSV writes a tab-separated listing for non-TTY output: type, name, octal mode, and raw byte size, with no header.
(io *iostreams.IOStreams, dir *repoDir)
| 152 | // writeTSV writes a tab-separated listing for non-TTY output: type, name, |
| 153 | // octal mode, and raw byte size, with no header. |
| 154 | func writeTSV(io *iostreams.IOStreams, dir *repoDir) error { |
| 155 | var sb strings.Builder |
| 156 | for _, e := range dir.Entries { |
| 157 | fmt.Fprintf(&sb, "%s\t%s\t%s\t%d\n", e.Type, e.Name, e.modeOctal(), e.Size) |
| 158 | } |
| 159 | _, err := io.Out.Write([]byte(sb.String())) |
| 160 | return err |
| 161 | } |
| 162 | |
| 163 | // writeTable writes the TTY listing as a TYPE/NAME/SIZE table. Names are colored |
| 164 | // by entry type and directories and submodules show "-" since git reports no size |
no test coverage detected