The Go Programming Language is the authoritative resource for any programmer who wants to learn Go. It shows how to write clear and idiomatic Go to solve real-world problems. The book does not assume prior knowledge of Go nor experience with any specific language, so youll find it accessible whether youre most comfortable with JavaScript, Ruby, Python, Java, or C++. The first chapter is a tutorial on the basic concepts of Go, introduced through programs for file I/O and text processing, simple graphics, and web clients and servers. Early chapters cover the structural elements of Go programs: syntax, control flow, data types, and the organization of a program into packages, files, and functions. The examples illustrate many packages from the standard library and show how to create new ones of your own. Later chapters explain the package mechanism in more detail, and how to build, test, and maintain projects using the go tool. The chapters on methods and interfaces introduce Gos unconventional approach to object-oriented programming, in which methods can be declared on any type and interfaces are implicitly satisfied. They explain the key principles of encapsulation, composition, and substitutability using realistic examples. Two chapters on concurrency present in-depth approaches to this increasingly important topic. The first, which covers the basic mechanisms of goroutines and channels, illustrates the style known as communicating sequential processes for which Go is renowned. The second covers more traditional aspects of concurrency with shared variables. These chapters provide a solid foundation for programmers encountering concurrency for the first time. The final two chapters explore lower-level features of Go. One covers the art of metaprogramming using reflection. The other shows how to use the unsafe package to step outside the type system for special situations, and how to use the cgo tool to create Go bindings for C libraries. The book features hundreds of interesting and practical examples of well-written Go code that cover the whole language, its most important packages, and a wide range of applications. Each chapter has exercises to test your understanding and explore extensions and alternatives. Source code is freely available for download from http://gopl.io/ and may be conveniently fetched, built, and installed using the go get command.
Cited By
- Tang W, Hillerström D, Lindley S and Morris J (2024). Soundly Handling Linearity, Proceedings of the ACM on Programming Languages, 8:POPL, (1600-1628), Online publication date: 5-Jan-2024.
- Santos J, Wang C, Wauters T and De Turck F (2023). Diktyo: Network-Aware Scheduling in Container-Based Clouds, IEEE Transactions on Network and Service Management, 20:4, (4461-4477), Online publication date: 1-Dec-2023.
- Avishahar-Zeira A and Lorenz D Could No-Code Be Code? Toward a No-Code Programming Language for Citizen Developers Proceedings of the 2023 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, (103-119)
- Andin I, Niskanen R, Dimitrov P and Fernandez-Reyes K TLS the Erlang/OTP Way (Experience Report) Proceedings of the 22nd ACM SIGPLAN International Workshop on Erlang, (2-13)
- Li B, Xiang Z, Wang X, Ruan H, Zhou J and Tan K FastWake: Revisiting Host Network Stack for Interrupt-mode RDMA Proceedings of the 7th Asia-Pacific Workshop on Networking, (1-7)
- Custódio R, Paulino H and Rito G Efficient Synchronization-Light Work Stealing Proceedings of the 35th ACM Symposium on Parallelism in Algorithms and Architectures, (39-49)
- Wu Q, Ekanayake A, Li R, Beard J and John L SPAMeR: Speculative Push for Anticipated Message Requests in Multi-Core Systems Proceedings of the 51st International Conference on Parallel Processing, (1-12)
- Miller B, Zhang M and Heymann E (2022). The Relevance of Classic Fuzz Testing: Have We Solved This One?, IEEE Transactions on Software Engineering, 48:6, (2028-2039), Online publication date: 1-Jun-2022.
- Cox R, Griesemer R, Pike R, Taylor I and Thompson K (2022). The Go programming language and environment, Communications of the ACM, 65:5, (70-78), Online publication date: 1-Apr-2022.
- Rivera E, Mergendahl S, Shrobe H, Okhravi H and Burow N Keeping Safe Rust Safe with Galeed Proceedings of the 37th Annual Computer Security Applications Conference, (824-836)
- Popescu N, Xu Z, Apostolakis S, August D and Levy A (2021). Safer at any speed: automatic context-aware safety enhancement for Rust, Proceedings of the ACM on Programming Languages, 5:OOPSLA, (1-23), Online publication date: 20-Oct-2021.
- Hartman J and Kopič D Scaling TensorFlow to 300 million predictions per second Proceedings of the 15th ACM Conference on Recommender Systems, (595-597)
- Bak S, Hernandez O, Gates M, Luszczek P and Sarkar V Task-graph scheduling extensions for efficient synchronization and communication Proceedings of the ACM International Conference on Supercomputing, (88-101)
- Dähling S, Razik L and Monti A (2021). Enabling scalable and fault-tolerant multi-agent systems by utilizing cloud-native computing, Autonomous Agents and Multi-Agent Systems, 35:1, Online publication date: 1-Apr-2021.
- Shiina S, Iwasaki S, Taura K and Balaji P Lightweight preemptive user-level threads Proceedings of the 26th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, (374-388)
- Sun X, Zou J, Li L and Luo M (2021). A blockchain-based online language learning system, Telecommunications Systems, 76:2, (155-166), Online publication date: 1-Feb-2021.
- Taha S, Wolff B and Ye L Philosophers May Dine - Definitively! Integrated Formal Methods, (419-439)
- Brito R and Valente M RefDiff4Go Proceedings of the 14th Brazilian Symposium on Software Components, Architectures, and Reuse, (101-110)
- Gottlob G, Lanzinger M, Longo D, Okulmus C and Pichler R The HyperTrac Project: Recent Progress and Future Research Directions on Hypergraph Decompositions Integration of Constraint Programming, Artificial Intelligence, and Operations Research, (3-21)
- Quenum J and Ishuuwa G Abstracting Containerisation and Orchestration for Cloud-Native Applications Cloud Computing – CLOUD 2020, (164-180)
- Farvardin K and Reppy J From folklore to fact: comparing implementations of stacks and continuations Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation, (75-90)
- Garcia-Contreras I, Morales J and Hermenegildo M Incremental Analysis of Logic Programs with Assertions and Open Predicates Logic-Based Program Synthesis and Transformation, (36-56)
- Nicol D Simulation-based Analysis of Network Rules Matching Proceedings of the 2019 ACM SIGSIM Conference on Principles of Advanced Discrete Simulation, (49-60)
- Rosa N, Campos G and Cavalcanti D An adaptive middleware in Go Proceedings of the 19th Workshop on Adaptive and Reflexive Middleware, (1-6)
- Andersen M, Kolb J, Chen K, Fierro G, Culler D and Katz R (2018). Democratizing Authority in the Built Environment, ACM Transactions on Sensor Networks, 14:3-4, (1-26), Online publication date: 30-Nov-2018.
- Marchiori M and Vieno E Negapedia Proceedings of the 2018 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining, (210-213)
- Valkov I, Chechina N and Trinder P Comparing languages for engineering server software Proceedings of the 33rd Annual ACM Symposium on Applied Computing, (218-225)
- Fürlinger K, Kowalewski R, Fuchs T and Lehmann B Investigating the performance and productivity of DASH using the Cowichan problems Proceedings of Workshops of HPC Asia, (11-20)
- Trinder P, Chechina N, Papaspyrou N, Sagonas K, Thompson S, Adams S, Aronis S, Baker R, Bihari E, Boudeville O, Cesarini F, Stefano M, Eriksson S, fördős V, Ghaffari A, Giantsios A, Green R, Hoch C, Klaftenegger D, Li H, Lundin K, Mackenzie K, Roukounaki K, Tsiouris Y and Winblad K (2017). Scaling Reliably, ACM Transactions on Programming Languages and Systems, 39:4, (1-46), Online publication date: 31-Dec-2018.
- Ionkov L, Maltzahn C and Lang M Optimized scatter/gather data operations for parallel storage Proceedings of the 2nd Joint International Workshop on Parallel Data Storage & Data Intensive Scalable Computing Systems, (1-6)
- Andersen M, Kolb J, Chen K, Culler D and Katz R Democratizing authority in the built environment Proceedings of the 4th ACM International Conference on Systems for Energy-Efficient Built Environments, (1-10)
- Algehed M and Jansson P VisPar: visualising dataflow graphs from the Par Monad Proceedings of the 6th ACM SIGPLAN International Workshop on Functional High-Performance Computing, (24-29)
- Chen L (2017). Continuous Delivery, Journal of Systems and Software, 128:C, (72-86), Online publication date: 1-Jun-2017.
- Tsvetkov L and Spivak A Localising Unsafe Software Resource Usage with Typed Code Model Proceedings of the 20th Conference of Open Innovations Association FRUCT, (466-471)
- Gil Y and Orrú M Code Spartanization Proceedings of the Symposium on Applied Computing, (1615-1622)
- Ferreira R, Bonadio Í and Durham A Secretary pattern Proceedings of the 11th Latin-American Conference on Pattern Languages of Programming, (1-11)
- Andersen M and Culler D BTrDB Proceedings of the 14th Usenix Conference on File and Storage Technologies, (39-52)
- Steffen M A Small-Step Semantics of a Concurrent Calculus with Goroutines and Deferred Functions Essays Dedicated to Frank de Boer on Theory and Practice of Formal Methods - Volume 9660, (393-406)
Index Terms
- The Go Programming Language