- Häftad (Paperback / softback)
- Antal sidor
- John Wiley & Sons Inc
- 234 x 190 x 33 mm
- Antal komponenter
- 463 g
Du kanske gillar
Yuval Noah HarariHäftad
Stephen MarshakMixed media product
Go Programming Language For Dummiesav Wei-Meng Lee259
Ready, set, program with Go! Now is the perfect time to learn the Go Programming Language. It's one of the most in-demand languages among tech recruiters and developers love its simplicity and power. Go Programming Language For Dummies is an easy way to add this top job skill to your toolkit. Written for novice and experienced coders alike, this book traverses basic syntax, writing functions, organizing data, building packages, and interfacing with APIs. Go-or GoLang, as it's also known-has proven to be a strong choice for developers creating applications for the cloud-based world we live in. This book will put you on the path to using the language that's created some of today's leading web applications, so you can steer your career where you want to Go! Learn how Go works and start writing programs and modules Install and implement the most powerful third-party Go packages Use Go in conjunction with web services and MySQL databases Keep your codebase organized and use Go to structure data With this book, you can join the growing numbers of developers using Go to create 21st century solutions. Step inside to take start writing code that puts data in users' hands.
- Skickas inom 7-10 vardagar.
- Gratis frakt inom Sverige över 199 kr för privatpersoner.
KundrecensionerHar du läst boken? Sätt ditt betyg »
Fler böcker av Wei-Meng Lee
Wei-Meng Lee is founder of Developer Learning Solutions, specializing in hands-on technology training. His name regularly appears in publications like DevX.com, MobiForge.com, and CODE Magazine. He is also the author of SwiftUI For Dummies, Beginning Swift Programming, Python Machine Learning, and Learning WatchKit Programming.
Introduction 1 About This Book 1 Foolish Assumptions 2 Icons Used in This Book 2 Beyond the Book 3 Where to Go from Here 3 Part 1: Getting Started with Go 5 Chapter 1: Hello, Go! 7 Seeing What Learning Go Can Do for You 8 Installing Go on Your Machine 9 macOS 10 Windows 11 Using an Integrated Development Environment with Go 12 Writing Your First Go Program 14 Compiling and running the program 15 Understanding how a Go program works 17 Making sense of the Go file structure 18 Compiling for multiple operating systems 19 Comparing Go with Other Languages 21 Syntax 21 Compilation 22 Concurrency 22 Library support 22 Chapter 2: Working with Different Data Types 23 Declaring Always-Changing Variables 24 Using the var keyword: Type-inferred variables 24 Specifying the data type: Explicitly typed variables 25 Using the short variable declaration operator 26 Declaring Never-Changing Constants 27 Removing Unused Variables 27 Dealing with Strings 29 Performing Type Conversions 30 Discovering the type of a variable 31 Converting a variable's type 32 Interpolating strings 34 Chapter 3: Making Decisions 37 Using If/Else Statements to Make Decisions 37 Laying the foundation for the if/else statement: Logical and comparison operators 38 Using the if/else statement 40 Short-circuiting: Evaluating conditions in Go 42 When You Have Too Many Conditions: Using the Switch Statement 46 Switching with fall-throughs 47 Matching multiple cases 48 Switching without condition 48 Chapter 4: Over and Over and Over: Using Loops 51 Performing Loops Using the for Statement 51 Iterating over a Range of Values 56 Iterating through arrays/slices 56 Iterating through a string 58 Using Labels with the for Loop 59 Chapter 5: Grouping Code into Functions 65 Defining a Function 65 Defining functions with parameters 66 Defining functions with multiple parameters 68 Passing arguments by value and by pointer 68 Returning values from functions 71 Naming return values 72 Working with variadic functions 72 Using Anonymous Functions 73 Declaring an anonymous function 73 Implementing closure using anonymous functions 74 Implementing the filter() function using closure 76 Part 2: Working with Data Structures 79 Chapter 6: Slicing and Dicing Using Arrays and Slices 81 Arming Yourself to Use Arrays 81 Declaring an array 82 Initializing an array 83 Working with multidimensional arrays 83 Sleuthing Out the Secrets of Slices 86 Creating an empty slice 86 Creating and initializing a slice 88 Appending to a slice 88 Slicing and Ranging 92 Extracting part of an array or slice 92 Iterating through a slice 95 Making copies of an array or slice 95 Inserting an item into a slice 97 Removing an item from a slice 99 Chapter 7: Defining the Blueprints of Your Data Using Structs 101 Defining Structs for a Collection of Items 101 Creating a Go Struct 104 Making a Copy of a Struct 105 Defining Methods in Structs 107 Comparing Structs 110 Chapter 8: Establishing Relationships Using Maps 113 Creating Maps in Go 113 Initializing a map with a map literal 115 Checking the existence of a key 115 Deleting a key 116 Getting the number of items in a map 116 Iterating over a map 117 Getting all the keys in a map 117 Setting the iteration order in a map 118 Sorting the items in a map by values 118 Using Structs and Maps in Go 121 Creating a map of structs 121 Sorting a map of structs 124 Chapter 9: Encoding and Decoding Data Using JSON 129 Getting Acquainted with JSON 129 Object 130 String 130 Boolean 131 Number 131 Object 132 Array 132 null 133 Decoding JSON 134 Decoding JSON to a struct 135 Decoding JSON to arrays 136 Decoding embedded objects 137 Mapping custom attribute names 140 Mapping unstructured data 141 Encoding JSON 144 Encoding structs to JSON 144 Encoding interfaces t