Adds example for link string method

This commit is contained in:
Tom Hudson 2016-06-17 00:23:46 +01:00
parent 7750da0170
commit 9700717000

View File

@ -49,3 +49,15 @@ func ExampleLinks_FilterByRel() {
// URL: https://api.github.com/user/58276/repos?page=2; Rel: last // URL: https://api.github.com/user/58276/repos?page=2; Rel: last
} }
func ExampleLink_String() {
link := linkheader.Link{
URL: "http://example.com/page/2",
Rel: "next",
}
fmt.Printf("Link: %s\n", link.String())
// Output:
// Link: <http://example.com/page/2>; rel="next"
}