Thanks, but that requires me to implement the code I would rather not have to reinvent given that shells like Bash, Ksh, and Fish already have code to do what I need. The problem is that those solutions are written in C and C++ respectively rather than Go. While I consider myself an expert in C (having started programming with it around 1985) I am only minimally competent in C++. I'll translate the Fish C++ code into Go if I have to but am hoping there is a published Go equivalent to save me that effort.
P.S., This is to remove the dependency on a daemon process to update a BoltDB database by the Fish shell. The BoltDB dependency (
go.etcd.io/bbolt) greatly increases the size and complexity of the Fish shell. The opaque binary database managed by BoltDB is also annoying. It would be preferable to use a flat file database using JSON or text protobufs for storing command history.