forked from mirror/readline
add doc for import package
This commit is contained in:
parent
c73eba9879
commit
733245997a
18
README.md
18
README.md
|
@ -37,10 +37,22 @@ You can read the source code in [example/main.go](https://github.com/chzyer/read
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
|
* Import package
|
||||||
|
|
||||||
|
```
|
||||||
|
go get gopkg.in/readline.v1
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```
|
||||||
|
go get https://github.com/chzyer/readline
|
||||||
|
```
|
||||||
|
|
||||||
* Simplest example
|
* Simplest example
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/chzyer/readline"
|
import "gopkg.in/readline.v1"
|
||||||
|
|
||||||
rl, err := readline.New("> ")
|
rl, err := readline.New("> ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -83,7 +95,7 @@ for {
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"github.com/chzyer/readline"
|
"gopkg.in/readline.v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
rl, err := readline.New("> ")
|
rl, err := readline.New("> ")
|
||||||
|
@ -113,7 +125,7 @@ for {
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"github.com/chzyer/readline"
|
"gopkg.in/readline.v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var completer = readline.NewPrefixCompleter(
|
var completer = readline.NewPrefixCompleter(
|
||||||
|
|
Loading…
Reference in New Issue