From 97007170007db76520a678c245acae3a323ba698 Mon Sep 17 00:00:00 2001 From: Tom Hudson Date: Fri, 17 Jun 2016 00:23:46 +0100 Subject: [PATCH] Adds example for link string method --- examples_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples_test.go b/examples_test.go index 65a75a1..f6e4300 100644 --- a/examples_test.go +++ b/examples_test.go @@ -49,3 +49,15 @@ func ExampleLinks_FilterByRel() { // 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: ; rel="next" +}