وبلاگ بلیان

Get Programming with Go

معرفی کتاب «Get Programming with Go» نوشتهٔ Youngman, Nathan;Peppé, Roger، منتشرشده توسط نشر Manning Publications Co. LLC در سال 2018. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Get Programming with Go» در دستهٔ بدون دسته‌بندی قرار دارد.

Get Programming with Go introduces you to the powerful Go language without confusing jargon or high-level theory. By working through 32 quick-fire lessons, you'll quickly pick up the basics of the innovative Go programming language! About the Technology Go is a small programming language designed by Google to tackle big problems. Large projects mean large teams with people of varying levels of experience. Go offers a small, yet capable, language that can be understood and used by anyone, no matter their experience. About the Book Hobbyists, newcomers, and professionals alike can benefit from a fast, modern language; all you need is the right resource! Get Programming with Go provides a hands-on introduction to Go language fundamentals, serving as a solid foundation for your future programming projects. You'll master Go syntax, work with types and functions, and explore bigger ideas like state and concurrency, with plenty of exercises to lock in what you learn. What's inside • Language concepts like slices, interfaces, pointers, and concurrency • Seven capstone projects featuring spacefaring gophers, Mars rovers, ciphers, and simulations • All examples run in the Go Playground - no installation required! About the Reader This book is for anyone familiar with computer programming, as well as anyone with the desire to learn. About the Author Nathan Youngman organizes the Edmonton Go meetup and is a mentor with Canada Learning Code. Roger Peppé contributes to Go and runs the Newcastle upon Tyne Go meetup. Get Programming with Go -1 Contents 6 Preface 8 Acknowledgments 9 About this book 11 Who should read this book 11 How this book is organized: A roadmap 11 About the code 13 Book forum 13 About the authors 14 Unit 0 Getting started 16 Lesson 1 Get ready, get set, Go 18 1.1 What is Go? 20 1.2 The Go Playground 21 1.3 Packages and functions 22 1.4 The one true brace style 24 Summary 25 Unit 1 Imperative programming 26 Lesson 2 A glorified calculator 28 2.1 Performing calculations 29 2.2 Formatted print 30 2.3 Constants and variables 32 2.4 Taking a shortcut 33 2.4.1 Declare multiple variables at once 33 2.4.2 Increment and assignment operators 34 2.5 Think of a number 35 Summary 36 Lesson 3 Loops and branches 38 3.1 True or false 39 3.2 Comparisons 40 3.3 Branching with if 41 3.4 Logical operators 42 3.5 Branching with switch 45 3.6 Repetition with loops 46 Summary 48 Lesson 4 Variable scope 49 4.1 Looking into scope 50 4.2 Short declaration 51 4.3 Narrow scope, wide scope 53 Summary 55 Lesson 5 Capstone: Ticket to Mars 56 Unit 2 Types 58 Lesson 6 Real numbers 60 6.1 Declaring floating-point variables 61 6.1.1 Single precision floating-point numbers 62 6.1.2 The zero value 62 6.2 Displaying floating-point types 63 6.3 Floating-point accuracy 64 6.4 Comparing floating-point numbers 66 Summary 66 Lesson 7 Whole numbers 68 7.1 Declaring integer variables 69 7.1.1 Integer types for every occasion 69 7.1.2 Knowing your type 70 7.2 The uint8 type for 8-bit colors 71 7.3 Integers wrap around 73 7.3.1 Looking at the bits 73 7.3.2 Avoid wrapping around time 75 Summary 76 Lesson 8 Big numbers 77 8.1 Hitting the ceiling 78 8.2 The big package 79 8.3 Constants of unusual size 81 Summary 82 Lesson 9 Multilingual text 83 9.1 Declaring string variables 84 9.1.1 Raw string literals 84 9.2 Characters, code points, runes, and bytes 85 9.3 Pulling the strings 87 9.4 Manipulating characters with Caesar cipher 88 9.4.1 A modern variant 89 9.5 Decoding strings into runes 90 Summary 92 Lesson 10 Converting between types 94 10.1 Types don?t mix 95 10.2 Numeric type conversions 96 10.3 Convert types with caution 97 10.4 String conversions 99 10.5 Converting Boolean values 101 Summary 102 Lesson 11 Capstone: The Vigen?re cipher 103 Unit 3 Building blocks 106 Lesson 12 Functions 108 12.1 Function declarations 109 12.2 Writing a function 113 Summary 114 Lesson 13 Methods 116 13.1 Declaring new types 117 13.2 Bring your own types 119 13.3 Adding behavior to types with methods 120 Summary 122 Lesson 14 First-class functions 123 14.1 Assigning functions to variables 124 14.2 Passing functions to other functions 125 14.3 Declaring function types 127 14.4 Closures and anonymous functions 127 Summary 131 Lesson 15 Capstone: Temperature tables 132 Unit 4 Collections 134 Lesson 16 Arrayed in splendor 136 16.1 Declaring arrays and accessing their elements 137 16.2 Don?t go out of bounds 138 16.3 Initialize arrays with composite literals 139 16.4 Iterating through arrays 140 16.5 Arrays are copied 141 16.6 Arrays of arrays 143 Summary 144 Lesson 17 Slices: windows into arrays 145 17.1 Slicing an array 146 17.1.1 Default indices for slicing 147 17.2 Composite literals for slices 148 17.3 The power of slices 149 17.4 Slices with methods 151 Summary 152 Lesson 18 A bigger slice 153 18.1 The append function 154 18.2 Length and capacity 155 18.3 Investigating the append function 156 18.4 Three-index slicing 157 18.5 Preallocate slices with make 158 18.6 Declaring variadic functions 159 Summary 160 Lesson 19 The ever-versatile map 161 19.1 Declaring a map 162 19.2 Maps aren?t copied 164 19.3 Preallocating maps with make 165 19.4 Using maps to count things 165 19.5 Grouping data with maps and slices 166 19.6 Repurposing maps as sets 167 Summary 168 Lesson 20 Capstone: A slice of life 170 20.1 A new universe 171 20.1.1 Looking at the universe 171 20.1.2 Seeding live cells 171 20.2 Implementing the game rules 172 20.2.1 Dead or alive? 172 20.2.2 Counting neighbors 172 20.2.3 The game logic 173 20.3 Parallel universe 173 Unit 5 State and behavior 174 Lesson 21 A little structure 176 21.1 Declaring a structure 177 21.2 Reusing structures with types 178 21.3 Initialize structures with composite literals 179 21.4 Structures are copied 180 21.5 A slice of structures 181 21.6 Encoding structures to JSON 182 21.7 Customizing JSON with struct tags 183 Summary 184 Lesson 22 Go?s got no class 185 22.1 Attaching methods to structures 186 22.2 Constructor functions 187 22.3 The class alternative 189 Summary 191 Lesson 23 Composition and forwarding 192 23.1 Composing structures 193 23.2 Forwarding methods 196 23.3 Name collisions 198 Summary 200 Lesson 24 Interfaces 201 24.1 The interface type 202 24.2 Discovering the interface 205 24.3 Satisfying interfaces 208 24.4 Summary 210 Lesson 25 Capstone: Martian animal sanctuary 211 Unit 6 Down the gopher hole 214 Lesson 26 A few pointers 216 26.1 The ampersand and the asterisk 217 26.1.1 Pointer types 219 26.2 Pointers are for pointing 220 26.2.1 Pointing to structures 223 26.2.2 Pointing to arrays 224 26.3 Enabling mutation 225 26.3.1 Pointers as parameters 225 26.3.2 Pointer receivers 226 26.3.3 Interior pointers 228 26.3.4 Mutating arrays 229 26.4 Pointers in disguise 230 26.4.1 Maps are pointers 230 26.4.2 Slices point at arrays 230 26.5 Pointers and interfaces 231 26.6 Use pointers wisely 233 Summary 233 Lesson 27 Much ado about nil 235 27.1 Nil leads to panic 236 27.2 Guarding your methods 238 27.3 Nil function values 239 27.4 Nil slices 240 27.5 Nil maps 241 27.6 Nil interfaces 242 27.7 An alternative to nil 243 Summary 244 Lesson 28 To err is human 245 28.1 Handling errors 246 28.2 Elegant error handling 248 28.2.1 Writing a file 248 28.2.2 The defer keyword 250 28.2.3 Creative error handling 251 28.3 New errors 253 28.3.1 Which error is which 255 28.3.2 Custom error types 256 28.4 Don?t panic 259 28.4.1 Exceptions in other languages 260 28.4.2 How to panic 260 28.4.3 Keep calm and carry on 261 Summary 262 Lesson 29 Capstone: Sudoku rules 263 Unit 7 Concurrent programming 266 Lesson 30 Goroutines and concurrency 268 30.1 Starting a goroutine 269 30.2 More than one goroutine 271 30.3 Channels 272 30.4 Channel surfing with select 275 30.5 Blocking and deadlock 277 30.6 A gopher assembly line 278 Summary 282 Lesson 31 Concurrent state 284 31.1 Mutexes 285 31.1.1 Mutex pitfalls 288 31.2 Long-lived workers 289 Summary 296 Lesson 32 Capstone: Life on Mars 297 32.1 A grid to rove on 297 32.2 Reporting discoveries 298 Where to Go from here 300 Under the radar 300 Beyond the playground 301 And much more 301 Solutions 302 Unit 0 302 Lesson 1 302 Unit 1 303 Lesson 2 303 Lesson 3 303 Lesson 4 304 Capstone 5 305 Unit 2 306 Lesson 6 306 Lesson 7 306 Lesson 8 307 Lesson 9 308 Lesson 10 309 Capstone 11 309 Unit 3 311 Lesson 12 311 Lesson 13 311 Lesson 14 312 Capstone 15 313 Unit 4 315 Lesson 16 315 Lesson 17 316 Lesson 18 317 Lesson 19 317 Capstone 20 318 Unit 5 321 Lesson 21 321 Lesson 22 321 Lesson 23 325 Lesson 24 327 Capstone 25 329 Unit 6 332 Lesson 26 332 Lesson 27 333 Lesson 28 334 Capstone 29 335 Unit 7 339 Lesson 30 339 Lesson 31 341 Capstone 32 344 Index 354 Symbols 354 A 354 B 354 C 354 D 355 E 355 F 355 G 356 H 356 I 356 J 356 L 356 M 356 N 357 O 357 P 357 R 358 S 358 T 359 U 359 V 359 W 359 Z 359 SummaryGet Programming with Go introduces you to the powerful Go language without confusing jargon or high-level theory. By working through 32 quick-fire lessons, you'll quickly pick up the basics of the innovative Go programming language! Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.About the TechnologyGo is a small programming language designed by Google to tackle big problems. Large projects mean large teams with people of varying levels of experience. Go offers a small, yet capable, language that can be understood and used by anyone, no matter their experience.About the BookHobbyists, newcomers, and professionals alike can benefit from a fast, modern language; all you need is the right resource! Get Programming with Go provides a hands-on introduction to Go language fundamentals, serving as a solid foundation for your future programming projects. You'll master Go syntax, work with types and functions, and explore bigger ideas like state and concurrency, with plenty of exercises to lock in what you learn.What's insideLanguage concepts like slices, interfaces, pointers, and concurrencySeven capstone projects featuring spacefaring gophers, Mars rovers, ciphers, and simulationsAll examples run in the Go Playground - no installation required!About the ReaderThis book is for anyone familiar with computer programming, as well as anyone with the desire to learn.About the AuthorNathan Youngman organizes the Edmonton Go meetup and is a mentor with Canada Learning Code. Roger Peppé contributes to Go and runs the Newcastle upon Tyne Go meetup.Table of ContentsUnit 0 - GETTING STARTEDGet ready, get set, Go Unit 1 - IMPERATIVE PROGRAMMINGA glorified calculator Loops and branches Variable scope Capstone: Ticket to MarsUnit 2 - TYPESReal numbers Whole numbers Big numbers Multilingual text Converting between types Capstone: The Vigenère cipher Unit 3 - BUILDING BLOCKSFunctions Methods First-class functions Capstone: Temperature tables Unit 4 - COLLECTIONSArrayed in splendor Slices: Windows into arrays A bigger slice The ever-versatile map Capstone: A slice of life Unit 5 - STATE AND BEHAVIORA little structure Go's got no class Composition and forwarding Interfaces Capstone: Martian animal sanctuary Unit 6 - DOWN THE GOPHER HOLEA few pointers Much ado about nil To err is human Capstone: Sudoku rules Unit 7 - CONCURRENT PROGRAMMINGGoroutines and concurrency Concurrent state Capstone: Life on Mars Get Programming With Go Introduces You To The Powerful Go Language Without Confusing Jargon Or High-level Theory. By Working Through 32 Quick-fire Lessons, You'll Quickly Pick Up The Basics Of The Innovative Go Programming Language! Purchase Of The Print Book Includes A Free Ebook In Pdf, Kindle, And Epub Formats From Manning Publications. About The Technology: Go Is A Small Programming Language Designed By Google To Tackle Big Problems. Large Projects Mean Large Teams With People Of Varying Levels Of Experience. Go Offers A Small, Yet Capable, Language That Can Be Understood And Used By Anyone, No Matter Their Experience. About The Book: Hobbyists, Newcomers, And Professionals Alike Can Benefit From A Fast, Modern Language; All You Need Is The Right Resource! Get Programming With Go Provides A Hands-on Introduction To Go Language Fundamentals, Serving As A Solid Foundation For Your Future Programming Projects. You'll Master Go Syntax, Work With Types And Functions, And Explore Bigger Ideas Like State And Concurrency, With Plenty Of Exercises To Lock In What You Learn. What's Inside: Language Concepts Like Slices, Interfaces, Pointers, And Concurrency Seven Capstone Projects Featuring Spacefaring Gophers, Mars Rovers, Ciphers, And Simulations All Examples Run In The Go Playground - No Installation Required! About The Reader: This Book Is For Anyone Familiar With Computer Programming, As Well As Anyone With The Desire To Learn. Unit 0 - GETTING STARTED Chapter 1. Get Ready, Get Set, Go Unit 1 - IMPERATIVE PROGRAMMING Chapter 1. A Glorified Calculator Chapter 2. Loops And Branches Chapter 3. Variable Scope Chapter 4. Capstone: Ticket To Mars Unit 2 - TYPES Chapter 1. Real Numbers Chapter 2. Whole Numbers Chapter 3. Big Numbers Chapter 4. Multilingual Text Chapter 5. Converting Between Types Chapter 6. Capstone: The Vigenère Cipher Unit 3 - BUILDING BLOCKS Chapter 1. Functions Chapter 2. Methods Chapter 3. First-Class Functions Chapter 4. Capstone: Temperature Tables Unit 4 - COLLECTIONS Chapter 1. Arrayed In Splendor Chapter 2. Slices: Windows Into Arrays Chapter 3. A Bigger Slice Chapter 4. The Ever-Versatile Map Chapter 5. Capstone: A Slice Of Life Unit 5 - STATE AND BEHAVIOR Chapter 1. A Little Structure Chapter 2. Go'S Got No Class Chapter 3. Composition And Forwarding Chapter 4. Interfaces Chapter 5. Capstone: Martian Animal Sanctuary Unit 6 - DOWN THE GOPHER HOLE Chapter 1. A Few Pointers Chapter 2. Much Ado About Nil Chapter 3. To Err Is Human Chapter 4. Capstone: Sudoku Rules Unit 7 - CONCURRENT PROGRAMMING Chapter 1. Goroutines And Concurrency Chapter 2. Concurrent State Chapter 3. Capstone: Life On Mars Get Programming with Go introduces you to the powerful Go language without confusing jargon or high-level theory. By working through 32 quick-fire lessons, you'll quickly pick up the basics of the innovative Go programming language! Hobbyists, newcomers, and professionals alike can benefit from a fast, modern language; all you need is the right resource! Get Programming with Go provides a hands-on introduction to Go language fundamentals, serving as a solid foundation for your future programming projects. You'll master Go syntax, work with types and functions, and explore bigger ideas like state and concurrency, with plenty of exercises to lock in what you learn. What's inside * Language concepts like slices, interfaces, pointers, and concurrency * Seven capstone projects featuring spacefaring gophers, Mars rovers, ciphers, and simulations * All examples run in the Go Playground - no installation required! This book is for anyone familiar with computer programming, as well as anyone with the desire to learn. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. "Go is a small programming language designed by Google to tackle big problems. Large projects mean large teams with people of varying levels of experience. Go offers a small, yet capable, language that can be understood and used by anyone, no matter their experience. Hobbyists, newcomers, and professionals alike can benefit from a fast, modern language; all you need is the right resource! Get Programming with Go provides a hands-on introduction to Go language fundamentals, serving as a solid foundation for your future programming projects. You'll master Go syntax, work with types and functions, and explore bigger ideas like state and concurrency, with plenty of exercises to lock in what you learn. Language concepts like slices, interfaces, pointers, and concurrency Seven capstone projects featuring spacefaring gophers, Mars rovers, ciphers, and simulations All examples run in the Go Playground - no installation required! This book is for anyone familiar with computer programming, as well as anyone with the desire to learn."--Page 4 de la couverture
دانلود کتاب Get Programming with Go