Skip to content

Instantly share code, notes, and snippets.

@mdwhatcott
Last active August 26, 2025 17:23
Show Gist options
  • Select an option

  • Save mdwhatcott/0d54ffd6cfef24ed4a66fcc91c7809f9 to your computer and use it in GitHub Desktop.

Select an option

Save mdwhatcott/0d54ffd6cfef24ed4a66fcc91c7809f9 to your computer and use it in GitHub Desktop.
steakhouse submission 2025-08-26T15:17:18Z
package main
import (
"fmt"
"os"
"strings"
)
func SearchString(input *os.File) (s string, err error) {
var result strings.Builder
_, _ = fmt.Fprintln(&result, input.Name())
listing, err := input.ReadDir(0)
for _, entry := range listing {
info, err := entry.Info()
if err != nil {
continue
}
_, _ = fmt.Fprintln(&result, entry.Name(), info.Size(), info.ModTime())
}
// _, err = io.Copy(&result, input)
return result.String(), err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment