官术网_书友最值得收藏!

Writing Programs in Go

This chapter will talk about many essential, interesting, and handy Go topics that will help you be more productive. I think it would be a good idea to start this chapter by compiling and running the Go code of the hw.go program from the previous chapter. Then, you will learn how to deal with the environment variables that can be used by Go, how to process the command-line arguments of a Go program, and how to print the output on the screen and get input from the user. Finally, you will see how to define functions in Go, learn about the extremely important defer keyword, look at the data structures that come with Go, and learn what Go interfaces are before checking out code that generates random numbers.

Therefore, in this chapter, you will become familiar with many Go concepts, including the following:

  • Compiling your Go programs
  • Go environment variables
  • Using the command-line arguments given to a Go program
  • Getting user input and printing the output on your screen
  • Go functions and the defer keyword
  • Go data structures and interfaces
  • Creating random numbers
主站蜘蛛池模板: 新宾| 渭源县| 天等县| 芜湖县| 五原县| 金阳县| 大关县| 嘉荫县| 宁河县| 北票市| 中西区| 苍溪县| 平凉市| 绍兴县| 广宁县| 大名县| 西城区| 岳西县| 仁寿县| 依兰县| 盐城市| 长乐市| 岳阳县| 昭通市| 南乐县| 封丘县| 扶沟县| 措美县| 红安县| 大英县| 阜平县| 芒康县| 新密市| 荣昌县| 延安市| 包头市| 杨浦区| 新安县| 牙克石市| 织金县| 仁化县|