Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/go-ipt
Interactive Pipe To: The golang cli interactive workflow.
https://github.com/afeiship/go-ipt
cli golang interactive ipt pipe
Last synced: 28 days ago
JSON representation
Interactive Pipe To: The golang cli interactive workflow.
- Host: GitHub
- URL: https://github.com/afeiship/go-ipt
- Owner: afeiship
- Created: 2016-10-19T05:45:51.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-11-28T02:47:16.000Z (about 1 month ago)
- Last Synced: 2024-11-28T03:18:21.278Z (about 1 month ago)
- Topics: cli, golang, interactive, ipt, pipe
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-ipt
> Interactive Pipe To: The golang cli interactive workflow.## installation
```sh
go get -u github.com/afeiship/go-ipt
```## usage
```go
package mainimport (
"github.com/afeiship/go-ipt"
)func main() {
type ColorObj struct {
Name string
Hex string
}opts := []ipt.Option[ColorObj]{
{Label: "Red", Value: ColorObj{"Red", "#FF0000"}},
{Label: "Green", Value: ColorObj{"Green", "#00FF00"}},
{Label: "Blue", Value: ColorObj{"Blue", "#0000FF"}},
}color, err := ipt.Ipt("What is your favorite color?", opts)
if err != nil {
panic(err)
}
println(color.Name, color.Hex)
}
```