O'Reilly logo

Go: Design Patterns for Real-World Projects by Mat Ryer, Mario Castro Contreras, Vladimir Vivien

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

This chapter presented an extensive look into the notion of source code organization and packages. Readers learned about the Go workspace and the import path. Readers were also introduced to the creation of packages and how to import packages to achieve code reusability. The chapter introduced mechanisms such as visibility of imported members and package initialization. The last portion of the chapter discussed the steps that are necessary to create an executable Go program from packaged code.

This was a lengthy chapter, and deservedly so to do justice to such a broad topic as package creation and management in Go. The next chapter returns to the Go types discussion with a detailed treatment of the composite types, such as array, slice, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required