reklama - zainteresowany?

Learning Go - Helion

Learning Go
ebook
Autor: Jon Bodner
ISBN: 9781492077169
stron: 374, Format: ebook
Data wydania: 2021-03-02
Księgarnia: Helion

Cena książki: 229,00 zł

Dodaj do koszyka Learning Go

Tagi: Inne - Programowanie

Go is rapidly becoming the preferred language for building web services. While there are plenty of tutorials available that teach Go's syntax to developers with experience in other programming languages, tutorials aren't enough. They don't teach Go's idioms, so developers end up recreating patterns that don't make sense in a Go context. This practical guide provides the essential background you need to write clear and idiomatic Go.

No matter your level of experience, you'll learn how to think like a Go developer. Author Jon Bodner introduces the design patterns experienced Go developers have adopted and explores the rationale for using them. You'll also get a preview of Go's upcoming generics support and how it fits into the language.

  • Learn how to write idiomatic code in Go and design a Go project
  • Understand the reasons for the design decisions in Go
  • Set up a Go development environment for a solo developer or team
  • Learn how and when to use reflection, unsafe, and cgo
  • Discover how Go's features allow the language to run efficiently
  • Know which Go features you should use sparingly or not at all

Dodaj do koszyka Learning Go

 

Osoby które kupowały "Learning Go", wybierały także:

  • Superinteligencja. Scenariusze, strategie, zagro
  • Poradnik design thinking - czyli jak wykorzysta
  • Kosymulacja. Elastyczne projektowanie i symulacja wielodomenowa
  • F# 4.0 dla zaawansowanych. Wydanie IV
  • Systemy reaktywne. Wzorce projektowe i ich stosowanie

Dodaj do koszyka Learning Go

Spis treści

Learning Go eBook -- spis treści

  • Preface
    • Who Should Read This Book
    • Conventions Used in This Book
    • Using Code Examples
    • OReilly Online Learning
    • How to Contact Us
    • Acknowledgments
  • 1. Setting Up Your Go Environment
    • Installing the Go Tools
    • The Go Workspace
    • The go Command
      • go run and go build
        • go run
        • go build
      • Getting Third-Party Go Tools
      • Formatting Your Code
    • Linting and Vetting
    • Choose Your Tools
      • Visual Studio Code
      • GoLand
      • The Go Playground
    • Makefiles
    • Staying Up to Date
    • Wrapping Up
  • 2. Primitive Types and Declarations
    • Built-in Types
      • The Zero Value
      • Literals
      • Booleans
      • Numeric Types
        • Integer types
        • The special integer types
        • Choosing which integer to use
        • Integer operators
        • Floating point types
        • Complex types (youre probably not going to use these)
      • A Taste of Strings and Runes
      • Explicit Type Conversion
    • var Versus :=
    • Using const
    • Typed and Untyped Constants
    • Unused Variables
    • Naming Variables and Constants
    • Wrapping Up
  • 3. Composite Types
    • ArraysToo Rigid to Use Directly
    • Slices
      • len
      • append
      • Capacity
      • make
      • Declaring Your Slice
      • Slicing Slices
        • Slices share storage sometimes
      • Converting Arrays to Slices
      • copy
    • Strings and Runes and Bytes
    • Maps
      • Reading and Writing a Map
      • The comma ok Idiom
      • Deleting from Maps
      • Using Maps as Sets
    • Structs
      • Anonymous Structs
      • Comparing and Converting Structs
    • Wrapping Up
  • 4. Blocks, Shadows, and Control Structures
    • Blocks
      • Shadowing Variables
      • Detecting Shadowed Variables
    • if   
    • for, Four Ways
      • The Complete for Statement
      • The Condition-Only for Statement
      • The Infinite for Statement
      • break and continue
      • The for-range Statement
        • Iterating over maps
        • Iterating over strings
        • The for-range value is a copy
      • Labeling Your for Statements
      • Choosing the Right for Statement
    • switch
    • Blank Switches
    • Choosing Between if and switch
    • gotoYes, goto
    • Wrapping Up
  • 5. Functions
    • Declaring and Calling Functions
      • Simulating Named and Optional Parameters
      • Variadic Input Parameters and Slices
      • Multiple Return Values
      • Multiple Return Values Are Multiple Values
      • Ignoring Returned Values
      • Named Return Values
      • Blank ReturnsNever Use These!
    • Functions Are Values
      • Function Type Declarations
      • Anonymous Functions
    • Closures
      • Passing Functions as Parameters
      • Returning Functions from Functions
    • defer
    • Go Is Call By Value
    • Wrapping Up
  • 6. Pointers
    • A Quick Pointer Primer
    • Dont Fear the Pointers
    • Pointers Indicate Mutable Parameters
    • Pointers Are a Last Resort
    • Pointer Passing Performance
    • The Zero Value Versus No Value
    • The Difference Between Maps and Slices
    • Slices as Buffers
    • Reducing the Garbage Collectors Workload
    • Wrapping Up
  • 7. Types, Methods, and Interfaces
    • Types in Go
    • Methods
      • Pointer Receivers and Value Receivers
      • Code Your Methods for nil Instances
      • Methods Are Functions Too
      • Functions Versus Methods
      • Type Declarations Arent Inheritance
      • Types Are Executable Documentation
      • iota Is for EnumerationsSometimes
    • Use Embedding for Composition
    • Embedding Is Not Inheritance
    • A Quick Lesson on Interfaces
    • Interfaces Are Type-Safe Duck Typing
    • Embedding and Interfaces
    • Accept Interfaces, Return Structs
    • Interfaces and nil
    • The Empty Interface Says Nothing
    • Type Assertions and Type Switches
    • Use Type Assertions and Type Switches Sparingly
    • Function Types Are a Bridge to Interfaces
    • Implicit Interfaces Make Dependency Injection Easier
    • Wire
    • Go Isnt Particularly Object-Oriented (and Thats Great)
    • Wrapping Up
  • 8. Errors
    • How to Handle Errors: The Basics
    • Use Strings for Simple Errors
    • Sentinel Errors
    • Errors Are Values
    • Wrapping Errors
    • Is and As
    • Wrapping Errors with defer
    • panic and recover
    • Getting a Stack Trace from an Error
    • Wrapping Up
  • 9. Modules, Packages, and Imports
    • Repositories, Modules, and Packages
    • go.mod
    • Building Packages
      • Imports and Exports
      • Creating and Accessing a Package
      • Naming Packages
      • How to Organize Your Module
      • Overriding a Packages Name
      • Package Comments and godoc
      • The internal Package
      • The init Function: Avoid if Possible
      • Circular Dependencies
      • Gracefully Renaming and Reorganizing Your API
    • Working with Modules
      • Importing Third-Party Code
      • Working with Versions
      • Minimum Version Selection
      • Updating to Compatible Versions
      • Updating to Incompatible Versions
      • Vendoring
      • pkg.go.dev
      • Additional Information
    • Publishing Your Module
    • Versioning Your Module
    • Module Proxy Servers
      • Specifying a Proxy Server
      • Private Repositories
    • Wrapping Up
  • 10. Concurrency in Go
    • When to Use Concurrency
    • Goroutines
    • Channels
      • Reading, Writing, and Buffering
      • for-range and Channels
      • Closing a Channel
      • How Channels Behave
    • select
    • Concurrency Practices and Patterns
      • Keep Your APIs Concurrency-Free
      • Goroutines, for Loops, and Varying Variables
      • Always Clean Up Your Goroutines
      • The Done Channel Pattern
      • Using a Cancel Function to Terminate a Goroutine
      • When to Use Buffered and Unbuffered Channels
      • Backpressure
      • Turning Off a case in a select
      • How to Time Out Code
      • Using WaitGroups
      • Running Code Exactly Once
      • Putting Our Concurrent Tools Together
    • When to Use Mutexes Instead of Channels
    • AtomicsYou Probably Dont Need These
    • Where to Learn More About Concurrency
    • Wrapping Up
  • 11. The Standard Library
    • io and Friends
    • time
      • Monotonic Time
      • Timers and Timeouts
    • encoding/json
      • Use Struct Tags to Add Metadata
      • Unmarshaling and Marshaling
      • JSON, Readers, and Writers
      • Encoding and Decoding JSON Streams
      • Custom JSON Parsing
    • net/http
      • The Client
      • The Server
        • Middleware
        • Use idiomatic third-party modules to enhance the server
    • Wrapping Up
  • 12. The Context
    • What Is the Context?
    • Cancellation
    • Timers
    • Handling Context Cancellation in Your Own Code
    • Values
    • Wrapping Up
  • 13. Writing Tests
    • The Basics of Testing
      • Reporting Test Failures
      • Setting Up and Tearing Down
      • Storing Sample Test Data
      • Caching Test Results
      • Testing Your Public API
      • Use go-cmp to Compare Test Results
    • Table Tests
    • Checking Your Code Coverage
    • Benchmarks
    • Stubs in Go
    • httptest
    • Integration Tests and Build Tags
    • Finding Concurrency Problems with the Race Checker
    • Wrapping Up
  • 14. Here There Be Dragons: Reflect, Unsafe, and Cgo
    • Reflection Lets Us Work with Types at Runtime
      • Types, Kinds, and Values
        • Types and kinds
        • Values
      • Making New Values
      • Use Reflection to Check If an Interfaces Value Is nil
      • Use Reflection to Write a Data Marshaler
      • Build Functions with Reflection to Automate Repetitive Tasks
      • You Can Build Structs with Reflection, but Dont
      • Reflection Cant Make Methods
      • Only Use Reflection If Its Worthwhile
    • unsafe Is Unsafe
      • Use unsafe to Convert External Binary Data
      • unsafe Strings and Slices
      • unsafe Tools
    • Cgo Is for Integration, Not Performance
    • Wrapping Up
  • 15. A Look at the Future: Generics in Go
    • Generics Reduce Repetitive Code and Increase Type Safety
    • Introducing Generics in Go
    • Use Type Lists to Specify Operators
    • Generic Functions Abstract Algorithms
    • Type Lists Limit Constants and Implementations
    • Things That Are Left Out
    • Idiomatic Go and Generics
    • Further Futures Unlocked
    • Wrapping Up
  • Index

Dodaj do koszyka Learning Go

Code, Publish & WebDesing by CATALIST.com.pl



(c) 2005-2024 CATALIST agencja interaktywna, znaki firmowe należą do wydawnictwa Helion S.A.