diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-24 00:24:23 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-24 00:24:23 +0300 |
| commit | 67ed9df5ed90475a99059cd5136373d85fff6ce4 (patch) | |
| tree | 476d20e8b2127aa4eff8e9ac840d36652e92982b /cmd | |
| parent | d334ad95fb3413d15549960a0c3c1c4739ae5055 (diff) | |
cmd/gt: fix stale comments and remove dead LogWriter code
- Fix package doc: reference 'internal' package (not 'cmd/gt/internal')
- Remove unused LogWriter struct and its methods (never instantiated,
repl.RunREPLWithLog passes *os.File directly as io.WriteCloser)
- Remove now-unused 'io' import
- Improve readStdin comment: clarify fallback truncates to 4096 bytes
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/gt/main.go | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/cmd/gt/main.go b/cmd/gt/main.go index 647f70f..cc4d3e2 100644 --- a/cmd/gt/main.go +++ b/cmd/gt/main.go @@ -43,12 +43,11 @@ // - rpn/: Handles RPN expression parsing and evaluation // - repl/: Provides interactive Read-Eval-Print Loop mode // -// See the cmd/gt/internal package for version information. +// See the internal package for version information. package main import ( "fmt" - "io" "os" "strings" @@ -71,22 +70,6 @@ func main() { } } -// LogWriter wraps io.Writer for use with io.MultiWriter in REPL mode. -// It provides a log writer that can be passed to the REPL. -type LogWriter struct { - writer io.WriteCloser -} - -// Write writes data to the log file. -func (lw *LogWriter) Write(p []byte) (n int, err error) { - return lw.writer.Write(p) -} - -// Close closes the log file. -func (lw *LogWriter) Close() error { - return lw.writer.Close() -} - // runCommand processes command-line arguments and executes the appropriate action. // // It handles: @@ -170,6 +153,7 @@ func runCommand(args []string) (string, error) { } // readStdin reads all input from stdin and returns it as a string. +// Uses /dev/stdin for full reads; falls back to a single 4096-byte buffer if unavailable. func readStdin() (string, error) { data, err := os.ReadFile("/dev/stdin") if err != nil { |
