Last active
August 26, 2025 17:23
-
-
Save mdwhatcott/0d54ffd6cfef24ed4a66fcc91c7809f9 to your computer and use it in GitHub Desktop.
Revisions
-
mdwhatcott revised this gist
Aug 26, 2025 . 1 changed file with 11 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,22 @@ 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 } -
mdwhatcott revised this gist
Aug 26, 2025 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,6 @@ func SearchString(input *os.File) (s string, err error) { // for _, entry := range listing { // _, _ = fmt.Fprintln(&result, entry.Name()) // } _, err = io.Copy(&result, input) return result.String(), err } -
mdwhatcott revised this gist
Aug 26, 2025 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ func SearchString(input *os.File) (s string, err error) { // for _, entry := range listing { // _, _ = fmt.Fprintln(&result, entry.Name()) // } result.WriteString("**MDWHATCOTT**") _, err = io.Copy(&result, input) return result.String(), err } -
mdwhatcott revised this gist
Aug 26, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ package main import ( "io" -
mdwhatcott revised this gist
Aug 26, 2025 . 1 changed file with 7 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,18 @@ package gist import ( "io" "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 { // _, _ = fmt.Fprintln(&result, entry.Name()) // } _, err = io.Copy(&result, input) return result.String(), err } -
mdwhatcott revised this gist
Aug 26, 2025 . 1 changed file with 10 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,19 @@ package main import ( "fmt" "io" "os" "strings" ) func SearchString(input *os.File) (string, error) { var result strings.Builder _, _ = fmt.Fprintln(&result, input.Name()) listing, err := input.ReadDir(0) for _, entry := range listing { _, _ = fmt.Fprintln(&result, entry.Name()) } _, err = io.Copy(&result, input) return result.String(), err } -
mdwhatcott revised this gist
Aug 26, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ package main import ( "bytes" -
mdwhatcott created this gist
Aug 26, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ package traitor import ( "bytes" "io" "os" ) func SearchString(input *os.File) (string, error) { var contents bytes.Buffer _, err := io.Copy(&contents, input) return contents.String(), err }