An open API service indexing awesome lists of open source software.

https://github.com/essentialkaos/go-linenoise

Go package wrapping the linenoise C library
https://github.com/essentialkaos/go-linenoise

golang linenoise readline

Last synced: 6 months ago
JSON representation

Go package wrapping the linenoise C library

Awesome Lists containing this project

README

        



Code Climate Maintainability
Codacy badge
GitHub Actions CI Status
GitHub Actions CodeQL Status

ExampleCI StatusLicense


`go-linenoise` is a Go package wrapping the [linenoise](https://github.com/antirez/linenoise) C library. Since `v3` we use [@yhirose](https://github.com/yhirose) [fork](https://github.com/yhirose/linenoise/tree/utf8-support) with UTF-8 support.

This is fork of [go.linenoise](https://github.com/GeertJohan/go.linenoise) package used in [EK](https://github.com/essentialkaos) projects.

### Example

```go
package main

// ////////////////////////////////////////////////////////////////////////// //

import (
"fmt"

linenoise "github.com/essentialkaos/go-linenoise/v3"
)

// ////////////////////////////////////////////////////////////////////////// //

func main() {
input, err := linenoise.Line("> ")

if err != nil {
fmt.Printf("Error: %v\n", err)
return
}

fmt.Printf("Input: %s\n", input)
}

```

### CI Status

| Branch | Status |
|--------|--------|
| `master` | [![CI](https://kaos.sh/w/go-linenoise/ci.svg?branch=master)](https://kaos.sh/w/go-linenoise/ci?query=branch:master) |
| `develop` | [![CI](https://kaos.sh/w/go-linenoise/ci.svg?branch=develop)](https://kaos.sh/w/go-linenoise/ci?query=branch:develop) |

### License
All code in this repository is licensed under a BSD license.
This project wraps [linenoise](https://github.com/antirez/linenoise) which is written by Salvatore Sanfilippo and Pieter Noordhuis. The license for linenoise is included in the files `linenoise.c` and `linenoise.h`.
For all other files please read the [LICENSE](LICENSE) file.