Skip to content

A simple Go program that consumes the icanhazdadjoke API

License

Notifications You must be signed in to change notification settings

nitsas/icanhazdadjoke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

icanhazdadjoke

A simple Go program that consumes the icanhazdadjoke API. Includes tests written in Ginkgo and Gomega.

How to build

git clone https://github.com/nitsas/icanhazdadjoke
cd icanhazdadjoke
go build

Usage

Assuming that you have built the program and named the result icanhazdadjoke (the default):

# Print a random joke:
$ icanhazdadjoke
Joke cxHYg3gFQf:
I got fired from the transmission factor, turns out I didn't put on enough shifts...

# Print a specific joke by id:
$ icanhazdadjoke EYoz51DtHtc
Joke EYoz51DtHtc:
What do computers and air conditioners have in common? They both become useless when you open windows.

How to run the tests

To execute the tests, you can run this from the root of the repo:

go test ./client

Or if you have ginkgo in your PATH:

ginkgo -r
# For more verbose output:
ginkgo -r -v

About

A simple Go program that consumes the icanhazdadjoke API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages