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 ## Basic Example
```go ```go
import "github.com/tomnomnom/linkheader" package main
header := "<https://api.github.com/user/58276/repos?page=2>; rel=\"next\"," + import (
"<https://api.github.com/user/58276/repos?page=2>; rel=\"last\"" "fmt"
links := linkheader.Parse(header)
for _, link := range links { "github.com/tomnomnom/linkheader"
fmt.Printf("URL: %s; Rel: %s\n", link.URL, link.Rel) )
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)
for _, link := range links {
fmt.Printf("URL: %s; Rel: %s\n", link.URL, link.Rel)
}
} }
// Output: // Output: