Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 905 Bytes

README.md

File metadata and controls

44 lines (31 loc) · 905 Bytes

go-editline

PkgGoDev

Go bindings for the 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: https://github.com/troglobit/editline#build--install.

go get github.com/maolonglong/go-editline

Usage

Some useful hints on how to use the library is available in the examples/ directory.

package main

import (
	"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)
	}
}