Go handbook Download PDF
GoLang Courses: Free Code Camp Tech World with Nana
Developed at Google and made open source in 2009
It's a multithread language
Designed to run on multiple cores and built to support concurrency
Concurrency in Go is cheap and easy
for performant applications
Docker, Vault, Cockroach is written in Go
GoLang projects: Hello world starter
The problem:
- The task is to build a super simple quiz with a few questions and a few alternatives for each question. With one correct answer per question.
- Backend - Golang
- Database - Just in-memory , so no database
- REST API or gRPC
- CLI that talks with the API, preferably using https://github.com/spf13/cobra ( as cli framework )
- cobra-cli Readme
Installing Cobra
Facing issues with init but go it to work and get the Go project to initialise and run
Testing the application and running "Hello World!"
Package fmt implements formatted I/O with functions analogous to C's printf and scanf. The format 'verbs' are derived from C's but are simpler.
io package Package io provides basic interfaces to I/O primitives. Its primary job is to wrap existing implementations of such primitives, such as those in package os, into shared public interfaces that abstract the functionality, plus some other related primitives.
Because these interfaces and primitives wrap lower-level operations with various implementations, unless otherwise informed clients should not assume they are safe for parallel execution.
Being able to print in the terminal
Create HTTP Server | http://localhost:3333
Decoding a csv file in go
The Problem
User stories/Use cases
-
User should be presented questions with a number of answers
-
User should be able to select just one answer per question
-
User should be able to answer all the questions and then post his/her answers and get back how many correct answers there had and be displayed to the user.
-
User should see how good he/she rated compared to others that have taken the quiz, "You scored higher than 60% of all quizzers"
I created a multiple choice quiz that had a true or false questions and a choice between A->D
Only one right answer per question.
There are 10 quesions the program loops through but the user only sees 5 questions at a time.
When the quiz is completed the user will see their results with the answer.
on the next screen the user will see the printed "You scored higher than 60% of all quizzers"
The user will be asked if they would like to retry the quiz or if they would like to exit.
Last Edit: September 2022