https://github.com/chenhg5/go-terminal
golang terminal
https://github.com/chenhg5/go-terminal
Last synced: 2 months ago
JSON representation
golang terminal
- Host: GitHub
- URL: https://github.com/chenhg5/go-terminal
- Owner: chenhg5
- Created: 2022-05-10T02:40:19.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-10T02:50:20.000Z (about 3 years ago)
- Last Synced: 2025-01-25T11:26:45.265Z (4 months ago)
- Language: Go
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-terminal
golang cross platform terminal
## Usage
```go
package mainimport (
"github.com/chenhg5/go-terminal"
)func main() {
term, err := terminal.NewTerminal("-> ")
if err != nil {
panic(err)
}
defer term.Close()for {
line, err := term.ReadLine()if err == io.EOF {
fmt.Println("bye bye~~")
return
}
if err != nil {
panic(err)
return
}term.Write([]byte(line))
}
}
```