INNER CODE UNIT · Go

printTable

ghostsecurity/reaper · internal/cli/format.go:33

func printTable(entries []entryRow) {
	if len(entries) == 0 {
		fmt.Println("no entries found")
		return
	}

	w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)

	fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t\n",
		"ID", "METHOD", "HOST", "PATH", "STATUS",
		pad("MS", 6), pad("REQ", 7), pad("RES", 7))

	for _, e := range entries {
		path := e.Path
		if e.Query != "" {
			path += "?" + e.Query
		}
		if len(path) > 60 {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…