You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Daniel Flanagan 375e25d42b
`go fmt`
5 months ago
.gitignore WIP 5 months ago Note on debug mode 5 months ago
go.mod WIP 5 months ago
go.sum WIP 5 months ago
main.go `go fmt` 5 months ago
swapi.go Remove dead code 5 months ago


go run .

And if you want all the debug output:

LOG_LEVEL=debug go run .

Original Readme

Challenge1 - Work with APIs and Libraries


The intent for this lesson is to build a more dynamic script that utilizes user input when ran. This added flexibility presents some challenges that we will need to overcome in the form of error handling and providing the user with helpful feedback.

If Statements

  • Comparing values using an if statement will allow you to run certain branches of your code if a condition is met, or not. This additional logic is helpful for writing smarter code.


  • Mastering loops is integral to running scalable scripts. Becoming familiar with for and while loops will allow you to write scripts that iterate smartly.


  • The print function is generally the main method used for any output from your code. Formatting and printing of outputs is important for producing human readable information.

Use Star Wars API

  • API Request - Pull all data about Starships from SWAPI
  • If Statements - List all ships that have named pilots
  • Loops - List all pilots of those ships
  • Print - Output must be human-readable


  • Clone this repo to your local computer using git clone
  • Create a new branch using git checkout -b <NEW-BRANCH>.
  • Add your own subfolder to the repo.
  • Add your files to the subfolder.


User choice

Recommend Go or Python

Additional Resources

Check your language of choice for a supporting library.

Example Output

Millennium Falcon
	Han Solo
	Lando Calrissian
	Nien Nunb
	Luke Skywalker
	Biggs Darklighter
	Wedge Antilles
	Jek Tono Porkins
TIE Advanced x1
	Darth Vader
Slave 1
	Boba Fett
Imperial shuttle
	Luke Skywalker
	Han Solo
	Arvel Crynyd
Naboo fighter
	Anakin Skywalker
	Gregar Typho
	Padmé Amidala
Naboo Royal Starship
	Ric Olié
	Darth Maul
Jedi starfighter
	Obi-Wan Kenobi
	Plo Koon
H-type Nubian yacht
	Padmé Amidala
Trade Federation cruiser
	Obi-Wan Kenobi
	Anakin Skywalker
T-70 X-wing fighter
	Poe Dameron
Naboo star skiff
	Obi-Wan Kenobi
	Padmé Amidala
Jedi Interceptor
	Obi-Wan Kenobi
	Anakin Skywalker
Belbullab-22 starfighter
	Obi-Wan Kenobi