type SearchResult … func (c *Corpus) Lookup(query string) SearchResult { … } // SearchResultDoc optionally specifies a function returning an HTML body // displaying search results matching godoc documentation. func (p *Presentation) SearchResultDoc(result SearchResult) []byte { … } // SearchResultCode optionally specifies a function returning an HTML body // displaying search results matching source code. func (p *Presentation) SearchResultCode(result SearchResult) []byte { … } // SearchResultTxt optionally specifies a function returning an HTML body // displaying search results of textual matches. func (p *Presentation) SearchResultTxt(result SearchResult) []byte { … } // HandleSearch obtains results for the requested search and returns a page // to display them. func (p *Presentation) HandleSearch(w http.ResponseWriter, r *http.Request) { … } func (p *Presentation) serveSearchDesc(w http.ResponseWriter, r *http.Request) { … } // tocColCount returns the no. of columns // to split the toc table to. func tocColCount(result SearchResult) int { … } // tocLen calculates the no. of items in the toc table // by going through various fields in the SearchResult // that is rendered in the UI. func tocLen(result SearchResult) int { … }