- Go Systems Programming
- Mihalis Tsoukalos
- 248字
- 2021-07-02 18:08:00
Exercises
- Browse the Go documentation site: https://golang.org/doc/.
- Write a Go program that keeps reading integers until you give the number 0 as input, then it prints the minimum and maximum integer in the input.
- Write the same Go program as before, but this time, you will get your input using command-line arguments. Which version do you think is better? Why?
- Write a Go program that supports two command-line options (-i and -k) in random order using if statements. Now change your program to support three command-line arguments. As you will see, the complexity of the latter program is just too much to handle using if statements.
- If the indices of a map were natural numbers, are there any cases that it would be wise and efficient to use a map instead of an array?
- Try to put the functionality of array2map.go into a separate function.
- Try to develop your own random number generator in Go that will still use the current time as a seed but not the math/rand package.
- Learn how to create a slice from an existing array. What happens when you make changes to the slice?
- Use the copy() function to make a copy of an existing slice. What happens when the destination slice is smaller than the source slice? What happens when the destination slice is bigger than the source slice?
- Try to write an interface for supporting points in 3D space. Then, use this interface to support points that reside on the x-axis.
推薦閱讀
- Mastering Visual Studio 2017
- Learning C# by Developing Games with Unity 2020
- Docker and Kubernetes for Java Developers
- Learning Chef
- C# Programming Cookbook
- Manga Studio Ex 5 Cookbook
- Instant Typeahead.js
- Mastering AndEngine Game Development
- GeoServer Beginner's Guide(Second Edition)
- 編程數學
- 運維前線:一線運維專家的運維方法、技巧與實踐
- Java EE Web應用開發基礎
- 青少年學Python(第2冊)
- 從零開始學Selenium自動化測試:基于Python:視頻教學版
- Visual Basic程序設計實驗指導及考試指南