Makes README example valid

This commit is contained in:
Tom Hudson 2015-12-10 13:53:34 -05:00
parent e8b35c877d
commit 1309adde4e

View File

@ -9,14 +9,22 @@ Docs can be found on [the GoDoc page](https://godoc.org/github.com/TomNomNom/lin
## Basic Example
```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\""
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)
}
}
// Output: