Save gopkgPath before for loop

This commit is contained in:
GeertJohan 2014-04-06 18:12:17 +02:00
parent c60021a937
commit ee829b2fb1

View File

@ -264,8 +264,9 @@ func renderPackagePage(resp http.ResponseWriter, req *http.Request, repo *Repo)
err = json.NewDecoder(gddoResp.Body).Decode(&synopsisResult) err = json.NewDecoder(gddoResp.Body).Decode(&synopsisResult)
gddoResp.Body.Close() gddoResp.Body.Close()
if err == nil { if err == nil {
gopkgPath := repo.GopkgPath()
for _, apiPkg := range synopsisResult.Results { for _, apiPkg := range synopsisResult.Results {
if apiPkg.Path == repo.GopkgPath() { if apiPkg.Path == gopkgPath {
data.Synopsis = apiPkg.Synopsis data.Synopsis = apiPkg.Synopsis
break break
} }