Package know queries different knowledge providers and parses their result. Partially supported are currently Google and Wolfram Alpha.
go get github.com/xconstruct/know
answers, errs := know.Ask("What is the capital of germany?")
// Get first answer
ans, ok := <-answers
if !ok {
fmt.Println("No answer found!")
for err := range errs {
fmt.Println(err)
}
return
}
fmt.Println(ans.Question, "is", ans.Answer)
// Output:
// Germany, Capital is Berlin