ENGLISH

Beginning Go Programming : Build Reliable and Efficient Applications with Go

Book information

Publisher
Apress
Year
2022
ISBN
9781484288580, 9781484288573
Language
english
Format
PDF
Filesize
5 MB (5481789 bytes)
Pages
\272
Time added
2022-12-04 12:32:46

Description

Understand and write programs in Go, a multi-paradigm language with built-in features for concurrent programming. This book enables developers to build software that is simple, reliable, and efficient. It'll also help beginners to start programming Go-based applications. Beginning Go Programming begins by explaining the programming fundamentals of the Go language, including basic syntax, data type and structures, and the use of functions and methods. Next, it covers string formatting, Unicode data handling, and how to use regular expressions in Go. Further, it discusses how to encode and decode JSON formatted data for Go applications, and how to work with HTTP in Go. It concludes by exploring concurrency and covering the most powerful features of Go, as well as tips and tricks related to it. After reading this book and working through its practical examples, you will be ready to begin programming your own Go-based applications. What You Will Learn Understand the fundamentals of the Go programming language Master the different features of Go and how to implement real-life scenarios using the language Work with text in Go, such as string formatting and Unicode data handling Work with HTTP in Go Who This Book Is For Programmers and developers looking to learn Go programming language concepts for efficient application building. Table of Contents About the Authors About the Technical Reviewer Preface Chapter 1: Introduction Is GoLang Static-Typed or Compiled? Compiled Programming Language Statically-Typed Language Is Go an Object-Oriented Programming Language? Features that Make GoLang the Premium Choice for Programming Intentionally Excluded Features from GoLang Go Programs Summary Chapter 2: Go Basics Ancestors of Go Go Syntax Installing Go Go Playground Developing Go Applications Using IDEs Getting Started Programming Go Applications Let’s Print Hello World! How to Execute a Go Program Keywords Variables Variable Data Types Variable Naming Conventions Declaring Variables Taking User Input Using scanf Using Scanln Using bufio Math Operators and Packages The Math Package Dates and Times Operators Precedence in Go Memory Management and Reference Values New vs Make Incorrect Memory Allocation Example Correct Memory Allocation Example Memory Deallocation Pointers Data Type What Is a Pointer? Declaring Pointers in Go Comparison with Java and C-Style Languages Ordered Values in Arrays and Slices Arrays in Go Declaring Arrays Initializing Arrays Accessing Array Elements Querying the Size of an Array Slices in Go Defining Slices The len( ) and cap( ) Functions Nil Slice Sub-Slicing in Go The append( ) and copy( ) Functions Sorting Slices Maps Defining Maps Adding Entries to a Map Object Deleting Entries from a Map Object Iterating Over Stored Values in a Map Object Structs Data Type Defining a Structure Accessing Members of a Structure Passing Structures as Function Arguments Pointers to Structures Program Flow If Statement Switch Statement For Statement The goto Statement Functions Defining a Function Doing Function Calls in Go Return More than One Value from Functions Passing Arguments to Functions Call by Value Example Call by Reference Example Methods Write/Read Text Files Write Text Files Read Text Files HTTP Package JSON Summary Chapter 3: Go Recipes: Programming Fundamentals and Basics Numbers and Slices in Go Working with Maps in Go Go’s Catch of Error Handling Defer and Panic Recovery Hands-on Challenge Solution Summary Chapter 4: Working with Text Go String Formatting and Working with Unicode Case-Insensitive Comparisons in Go Regular Expressions and Reading Text Files with Go Hands-on Challenge Solution Summary Chapter 5: Structs, Methods, and Interfaces Go Structs, Methods, and Interfaces Structs Declaring Structs in Go Creating Instances of a Struct Type Recipe to See Structs in Action Methods Declaring Methods in Go Recipe to See Methods in Action Interfaces Declaring Interfaces in Go Implementing Interfaces in Go Recipe to See Interfaces in Action Empty Interface and Working with IOTA in Go JSON Encoding/Decoding Generics Hands-on Challenge Solution Summary Chapter 6: Working with JSON JSON Package Unmarshalling JSON with GO Parsing Complex JSON with Go Marshalling JSON with Go Handling Missing Values and Zeros in JSON Using mapstructure to Handle Arbitrary JSON Summary Chapter 7: HTTP Go and HTTP Calls Authentication and Writing an HTTP Server in Go REST with gorilla/mux Hands-on Challenge Solution Summary Chapter 8: Concurrency Understanding Goroutines Converting Sequential Code into Concurrent Code Using Goroutines with Shared Resources Seeing the Impact of Shared Resources on Goroutines Accessing Shared Resources Using Mutual Exclusion Modifying Shared Resources Using Atomic Counters Synchronizing Goroutines sync.WaitGroup and sync.Once Timeouts in Go Pooling Goroutines Hands-On Challenge Solution Summary Chapter 9: Tricks and Handy Tips Importing Packages Check What Packages Are Being Imported by Your Application Use goimports Instead of gofmt Code Organization To Use or Not to Use: Custom Constructors Modularizing and Organizing Code into Packages Dependency Package Management Compiler Optimizations Using Git’s SHA to Set the Build ID The Case of Elegant Constants, aka IOTA Auto Increment Custom Types Skipping Values Expressions Tricky Constants Summary Index

Similar books

Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36

2010 · PDF

THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.

1858 · PDF

Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.

2022 · PDF

The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians

1809 · PDF