From ee829b2fb1535c75b783630d23f5fa3b9cc358e9 Mon Sep 17 00:00:00 2001 From: GeertJohan Date: Sun, 6 Apr 2014 18:12:17 +0200 Subject: [PATCH] Save gopkgPath before for loop --- page.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/page.go b/page.go index 93c429e..3675486 100644 --- a/page.go +++ b/page.go @@ -264,8 +264,9 @@ func renderPackagePage(resp http.ResponseWriter, req *http.Request, repo *Repo) err = json.NewDecoder(gddoResp.Body).Decode(&synopsisResult) gddoResp.Body.Close() if err == nil { + gopkgPath := repo.GopkgPath() for _, apiPkg := range synopsisResult.Results { - if apiPkg.Path == repo.GopkgPath() { + if apiPkg.Path == gopkgPath { data.Synopsis = apiPkg.Synopsis break }