<commit_before>// Ported from fabioxgn/go-bot
package ported

import (
	"fmt"
	lazlo "github.com/djosephsen/lazlo/lib"
	"github.com/fabioxgn/go-bot/web"
	"net/url"
)

const (
	godocSiteURL    = "http://godoc.org"
	noPackagesFound = "No packages found."
)

type godocResults struct {
	Results []struct {
		Path     string `json:"path"`
		Synopsis string `json:"synopsis"`
	} `json:"results"`
}

var godocSearchURL = "http://api.godoc.org/search"

var GoDoc = &lazlo.Module{
	Name:  `GoDoc`,
	Usage: `godoc <package name>: Searchs godoc.org and displays the first result.`,
	Run:   goDocRun,
}

func goDocRun(b *lazlo.Broker) {
	cb := b.MessageCallback(`(?i)^godoc ([^\s]+)$`, false)
	for {
		pm := <-cb.Chan
		data := &godocResults{}<commit_msg>Update to godoc help output<commit_after>// Ported from fabioxgn/go-bot
package ported

import (
	"fmt"
	lazlo "github.com/djosephsen/lazlo/lib"
	"github.com/fabioxgn/go-bot/web"
	"net/url"
)

const (
	godocSiteURL    = "http://godoc.org"
	noPackagesFound = "No packages found."
)

type godocResults struct {
	Results []struct {
		Path     string `json:"path"`
		Synopsis string `json:"synopsis"`
	} `json:"results"`
}

var godocSearchURL = "http://api.godoc.org/search"

var GoDoc = &lazlo.Module{
	Name:  `GoDoc`,
	Usage: `godoc <package name>: Searchs godoc.org and displays the first 10 results.`,
	Run:   goDocRun,
}

func goDocRun(b *lazlo.Broker) {
	cb := b.MessageCallback(`(?i)^godoc ([^\s]+)$`, false)
	for {
		pm := <-cb.Chan
		data := &godocResults{}
{'fraction_non_alphanumeric': 0.16733067729083664, 'fraction_numerical': 0.0013280212483399733, 'mean_word_length': 3.9572368421052633, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7271179', 'n_tokens_mistral': 623, 'n_tokens_neox': 596, 'n_words': 132}