Skip to content

EN01_Minimum_configuration

HAYAMA_Kaoru edited this page Oct 11, 2023 · 1 revision

The minimum required configuration is as shown in README.md, just declare an instance and call the ReadLine method.

package main

import (
	"context"
	"fmt"

	"github.com/nyaosorg/go-readline-ny"
)

func main() {
	var editor readline.Editor
	text, err := editor.ReadLine(context.Background())
	if err != nil {
		fmt.Printf("ERR=%s\n", err.Error())
	} else {
		fmt.Printf("TEXT=%s\n", text)
	}
}