<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Exercises on Go Basics Training</title><link>/docs/exercises/</link><description>Recent content in Exercises on Go Basics Training</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/exercises/index.xml" rel="self" type="application/rss+xml"/><item><title>ASCII Pyramid</title><link>/docs/exercises/lab_ascii_pyramid/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/exercises/lab_ascii_pyramid/</guid><description>Task Create a function which prints an ASCII Pyramid. The function must take the height of the pyramid as parameter.
If you call the function with 5 as parameter we should get the following pyramid:
* *** ***** ******* ********* Tips Standard library packages The package fmt contains various print functions.
Standard library functions With fmt.Print you can print strings:
// print space fmt.Print(&amp;#34; &amp;#34;) // print newline fmt.Print(&amp;#34;\n&amp;#34;) Calculate number of spaces and stars On each line you have to print the appropriate number of spaces and stars:</description></item><item><title>Number Guessing Game</title><link>/docs/exercises/lab_number_guessing_game/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/exercises/lab_number_guessing_game/</guid><description>Task Write a number guessing game. At the start create a random number. Then ask the user to enter a number on the command line (standard input) until the user guesses the correct number.
If the user enters the string exit the program should exit.
The output could look like in the following example. In the example the user enters the numbers 5, 7 and 6.
guess number between 0 and 9 guess number: 5 wrong number.</description></item><item><title>HTTP Client</title><link>/docs/exercises/lab_http_client/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/exercises/lab_http_client/</guid><description>Overview We will write a small CLI tool that gets the follower count and the full name of a specific Github user.
Information about a Github user we can obtain from the Github REST API under https://api.github.com/users/&amp;lt;user&amp;gt;. Besides many other information a call to https://api.github.com/users/mitchellh returns the following information:
{ &amp;#34;login&amp;#34;: &amp;#34;mitchellh&amp;#34;, ... &amp;#34;name&amp;#34;: &amp;#34;Mitchell Hashimoto&amp;#34;, ... &amp;#34;followers&amp;#34;: 9973, ... } The Github API limits the number of unauthenticated requests per IP to 60 per hour.</description></item><item><title>HTTP Server</title><link>/docs/exercises/lab_http_server/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/exercises/lab_http_server/</guid><description>Part 1: Ping and Logger Tasks Run a server and implement a handler which returns pong on the endpoint /ping. Create a middleware to log every request. Log the path, method, duration and the IP of the client of the request. Your log should look similar to this:
2022/04/11 10:03:08 remote=192.168.1.143 path=/foo method=GET duration=13.765874ms Tips See 5.4. HTTP Server.
Standard library packages Consider using the log package from the standard library You can measure time using the time package: Measure duration start := time.</description></item></channel></rss>