https://github.com/maolonglong/go-editline
Go bindings for the editline.
https://github.com/maolonglong/go-editline
auto-completion cgo editline go golang readline
Last synced: 3 months ago
JSON representation
Go bindings for the editline.
- Host: GitHub
- URL: https://github.com/maolonglong/go-editline
- Owner: maolonglong
- License: apache-2.0
- Created: 2023-09-27T03:52:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-27T03:55:47.000Z (about 2 years ago)
- Last Synced: 2025-06-01T18:39:16.894Z (4 months ago)
- Topics: auto-completion, cgo, editline, go, golang, readline
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-editline
[](https://pkg.go.dev/github.com/maolonglong/go-editline)
Go bindings for the [editline](https://github.com/troglobit/editline).
## Installation
This library depends on editline and requires it to be installed beforehand. You can refer to the following link for instructions on how to build and install editline: .
```bash
go get github.com/maolonglong/go-editline
```## Usage
Some useful hints on how to use the library is available in the [examples/](./examples/) directory.
```go
package mainimport (
"fmt"
"io""github.com/maolonglong/go-editline"
)func main() {
defer editline.Uninitialize()for {
line, err := editline.ReadLine("> ")
if err != nil {
if err == io.EOF {
break
}
panic(err)
}fmt.Println(line)
}
}
```