What You Might Not Know About Go Packages

In the previous chapter, we talked about developing and using custom data structures such as linked lists, binary trees, and hash tables as well as generating random numbers and difficult-to-guess passwords in Go.

The main focus of this chapter is Go packages, which is the Go way of organizing, delivering, and using code. The most common components of a Go package are functions, which are pretty flexible in Go. In the last part of this chapter you will see some advanced packages that belong to the Go standard library in order to understand better that not all Go packages are created equal.

In this chapter of Mastering Go, you will learn the following topics:

  • Developing functions in Go
  • Anonymous functions
  • Functions that return multiple values
  • Naming the return values of a function
  • Functions that return other functions
  • Functions that get other functions as parameters
  • Developing Go packages
  • Private and Public package objects
  • Using the init() function in packages
  • The sophisticated html/template standard Go package
  • The text/template standard package, another truly sophisticated Go package that has its own language
  • The syscall standard Go package, which is a low-level package that, although you might not use directly, it is used extensively by other Go packages
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.194.57