/catfacts

Catfacts API client in golang

Primary LanguageGoMIT LicenseMIT

catfacts

A cat facts API client library/CLI for golang

Installation

catfacts supports go modules. To install using go > 1.11, just run go get github.com/amccarthy1/catfacts

Usage

package main

import (
    "fmt"
    "github.com/amccarthy1/catfacts"
)

func main() {
    client := catfacts.NewClient()
    fact, err := client.GetRandomFact()
    if err != nil {
        panic(err)
    }
    fmt.Println(fact.Fact)
}

You can always look through the godoc for more detailed documentation.

If you'd prefer an example of an application using the client, check out amccarthy1/catfacts-cli.