When running the tgpt command with the -w or --whole flag, the program crashes with a runtime error indicating an "invalid memory address or nil pointer dereference." This issue seems to occur in the getWholeText function.
Steps to Reproduce:
Run the command: tgpt -w "hello"
Observe the crash with the following error message:
The error seems to originate from the getWholeText function in helper.go and is called from the main function in main.go. It is possible that one of the pointers or variables used in these functions is not properly initialized.
Expected Behavior:
The command should execute without crashing and return the expected output.
When running the
tgpt
command with the-w
or--whole
flag, the program crashes with a runtime error indicating an "invalid memory address or nil pointer dereference." This issue seems to occur in thegetWholeText
function.Steps to Reproduce:
tgpt -w "hello"
Potential Cause:
The error seems to originate from the
getWholeText
function inhelper.go
and is called from themain
function inmain.go
. It is possible that one of the pointers or variables used in these functions is not properly initialized.Expected Behavior:
The command should execute without crashing and return the expected output.
Environment:
tgpt
version: 2.8.1