Makes README example valid
This commit is contained in:
parent
e8b35c877d
commit
1309adde4e
16
README.mkd
16
README.mkd
|
@ -9,14 +9,22 @@ Docs can be found on [the GoDoc page](https://godoc.org/github.com/TomNomNom/lin
|
||||||
## Basic Example
|
## Basic Example
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/tomnomnom/linkheader"
|
package main
|
||||||
|
|
||||||
header := "<https://api.github.com/user/58276/repos?page=2>; rel=\"next\"," +
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/tomnomnom/linkheader"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
header := "<https://api.github.com/user/58276/repos?page=2>; rel=\"next\"," +
|
||||||
"<https://api.github.com/user/58276/repos?page=2>; rel=\"last\""
|
"<https://api.github.com/user/58276/repos?page=2>; rel=\"last\""
|
||||||
links := linkheader.Parse(header)
|
links := linkheader.Parse(header)
|
||||||
|
|
||||||
for _, link := range links {
|
for _, link := range links {
|
||||||
fmt.Printf("URL: %s; Rel: %s\n", link.URL, link.Rel)
|
fmt.Printf("URL: %s; Rel: %s\n", link.URL, link.Rel)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output:
|
// Output:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user