From 1309adde4e7a254ae2e050c66f6868388a42b527 Mon Sep 17 00:00:00 2001 From: Tom Hudson Date: Thu, 10 Dec 2015 13:53:34 -0500 Subject: [PATCH] Makes README example valid --- README.mkd | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.mkd b/README.mkd index 322c121..b7220cd 100644 --- a/README.mkd +++ b/README.mkd @@ -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 := "; rel=\"next\"," + - "; rel=\"last\"" -links := linkheader.Parse(header) +import ( + "fmt" -for _, link := range links { - fmt.Printf("URL: %s; Rel: %s\n", link.URL, link.Rel) + "github.com/tomnomnom/linkheader" +) + +func main() { + header := "; rel=\"next\"," + + "; rel=\"last\"" + links := linkheader.Parse(header) + + for _, link := range links { + fmt.Printf("URL: %s; Rel: %s\n", link.URL, link.Rel) + } } // Output: