Save gopkgPath before for loop
This commit is contained in:
parent
c60021a937
commit
ee829b2fb1
3
page.go
3
page.go
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user