numbersapi

package module
v0.0.0-...-704cb0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 6 Imported by: 0

README

gonumbersapi

A go module that wraps around numbersapi

Usage

package main

import (
  "fmt"

  gna "github.com/anders-14/gonumbersapi"
)

func main() {
  // Math fact
  fmt.Println(gna.MathFact(42))

  // Fun fact
  fmt.Println(gna.FunFact(14))

  // What happened on a given date (dd/mm - This ain't murica)
  fmt.Println(gna.DateFact("31/12"))

  // What happened in a given year
  fmt.Println(gna.YearFact(2021))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateFact

func DateFact(date string) string

DateFact returns a fact about the date passed on the format dd/mm No freedom formatting allowed

func FunFact

func FunFact(number int) string

FunFact returns some random trivia about the number passed to it

func MathFact

func MathFact(number int) string

MathFact return a mathematical fact about the number passed to it

func YearFact

func YearFact(year int) string

YearFact returns a fact about the year passed to it

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL