golang-book-examples-master
所属分类:GO语言编程
开发工具:GO
文件大小:2528KB
下载次数:0
上传日期:2020-02-03 16:41:31
上 传 者:
龙将军
说明: 你很可能从某种途径听说过 Go 语言。它越来越受欢迎,并且有充分的理由可以证明。 Go 快速、简单,有强大的社区支持。学习这门语言最令人兴奋的一点是它的并发模型。 Go 的并发原语使创建多线程并发程序变得简单而有趣。我将通过插图介绍 Go 的并发原语,希望能点透相关概念以方便后续学习。本文是写给 Go 语言编程新手以及准备开始学习 Go 并发原语 (goroutines 和 channels) 的同学。
云时代,并发和集群化,是服务标配,
(In the cloud age, concurrency and clustering are standard services)
文件列表:
.travis.yml (68, 2020-01-30)
hello_world.go (73, 2020-01-30)
hour01 (0, 2020-01-30)
hour01\example01.go (73, 2020-01-30)
hour02 (0, 2020-01-30)
hour02\example01.go (134, 2020-01-30)
hour02\example02.js (78, 2020-01-30)
hour02\example03.js (85, 2020-01-30)
hour02\example04.go (148, 2020-01-30)
hour02\example05.go (72, 2020-01-30)
hour02\example06.go (98, 2020-01-30)
hour02\example07.go (219, 2020-01-30)
hour02\example08.go (195, 2020-01-30)
hour03 (0, 2020-01-30)
hour03\example01.go (90, 2020-01-30)
hour03\example02.go (93, 2020-01-30)
hour03\example03.go (82, 2020-01-30)
hour03\example04.go (108, 2020-01-30)
hour03\example05.go (120, 2020-01-30)
hour03\example06.go (137, 2020-01-30)
hour03\example07.go (143, 2020-01-30)
hour03\example08.go (80, 2020-01-30)
hour03\example09.go (108, 2020-01-30)
hour03\example10.go (315, 2020-01-30)
hour03\example11.go (86, 2020-01-30)
hour03\example12.go (156, 2020-01-30)
hour03\example13.go (157, 2020-01-30)
hour03\example14.go (112, 2020-01-30)
hour03\example15.go (147, 2020-01-30)
hour04 (0, 2020-01-30)
hour04\example01.go (152, 2020-01-30)
hour04\example02.go (196, 2020-01-30)
hour04\example03.go (242, 2020-01-30)
hour04\example04.go (132, 2020-01-30)
hour04\example05.go (324, 2020-01-30)
hour04\example06.go (128, 2020-01-30)
hour04\example07.go (219, 2020-01-30)
... ...
# Golang Book Examples
[![Build Status](https://travis-ci.org/shapeshed/golang-book-examples.svg?branch=master)](https://travis-ci.org/shapeshed/golang-book-examples)
## [1. Getting Started][1]
* Introducing Go
* Installing Go
* Setting Up Your Environment
* Writing Your First Go Program: Hello World
## [2. Understanding Types][2]
* What Is a Data Type?
* Differentiating Between Static and Dynamic Typing
* Implementing Booleans
* Understanding Numeric Types
* Checking the Type of a Variable
* Converting Between Types
## [3. Understanding Variables][3]
* What Is a Variable?
* Declaring Shorthand Variables
* Understanding Variables and Zero Values
* Writing a Short Variable Declaration
* Styles of Variable Declaration
## [4. Using Functions in Go][4]
* What Is a Function?
* Defining Variadic Functions
* Using Named Return Values
* Using Recursive Functions
* Passing Functions as Values
## [5. Using Control Flow][5]
* Using the if Statement
* Using the else Statement
* Using the else if Statement
* Using Comparison Operators
* Using Arithmetic Operators
* Using Logical Operators
* Using the switch Statement
* Looping with the for Statement
* Using the defer Statement
## [6. Working with Arrays, Slices, Maps][6]
* Working with Arrays
* Working with Slices
* Working with Maps
## [7. Using Structs and Pointers][7]
* What Is a Struct
* Initializing a Struct
* Nesting Structs
* Creating Default Values for Structs
* Comparing Structs
* Understanding Public and Private Values
* Differentiating Between Point and Value References
## [8. Creating Methods And Interfaces][8]
* Using Methods
* Creating Method Sets
* Working with Methods and Pointers
* Using Interfaces
## [9. Working with Strings][9]
* Creating String Literals
* Understanding Rune Literals
* Concatenating Strings
## [10. Error Handling][10]
* Handling Errors and Idiomatic Go
* Understanding the Error Type
* Creating Errors
* Formatting Errors
* Returning an Error from a Function
* Errors and Usability
* Don't panic
## [11. Working with Goroutines][11]
* Understanding Concurrency
* Concurrency Versus Parallelism
* Understanding Concurrency Through a Web Browser
* Blocking and Non-Blocking Code
* Handling Concurrent Operations with Goroutines
* Using Goroutines to Manage Latency
* Defining Goroutines
## [12. Introducing Channels][12]
* Using Channels
* Using Buffered Channels
* Blocking and Flow Control
* Using Channels as Function Arguments
* Employing the select Statement
* Quitting Channels
## [13. Packages][13]
* Importing Packages
* Understanding Package Usage
* Using Third-Party Packages
* Installing a Third-Party Package
* Managing Third-Party Dependencies
## [14. Naming Conventions in Go][14]
* Formatting Code in Go
* Using gofmt
* Configuring Text Editors
* Naming Conventions
* Using golint
* Using godoc
* Automating Workflow
## [15. Testing and Performance][15]
* Testing: The Most Important Aspect of Software Development
* testing Package
* Running Table Tests
* Benchmarking in Go
* Providing Test Coverage
## [16. Debugging][16]
* Logging
* Printing Data
* Using the fmt Package
* Using Delve
* Using gdb
## [17. Using Command Line Programs][17]
* Operating with Inputs and Outputs
* Accessing Raw Command-Line Arguments
* Parsing Command-Line Flags
* Working with Types
* Customizing Help Text
* Creating Subcommands
* POSIX Compliance
* Installing and Sharing Command-Line Programs
## [18. Creating HTTP Servers][18]
* Announcing Your Presence with the "Hello World" Web Server
* Examing Requests and Responses
* Working with Handler Functions
* Handling 404s
* Setting a Header
* Responding to Different Types of Requests
* Receiving Data from GET and POST Requests
## [19. Creating HTTP Clients with Go][19]
* Understanding HTTP
* Making a GET Request
* Making a POST Request
* Gaining Further Control over HTTP Requests
* Debugging HTTP Requests
* Dealing With Timeouts
## [20. Working with JSON][20]
* Introducing JSON
* Using JSON APIs
* Using JSON with Go
* Decoding JSON
* Mapping Data Types
* Working with JSON Received over HTTP
## [21. Working With files][21]
* The Importance of Files
* Reading and Writing Files with the ioutil Package
* Writing to a File
* Listing a Directory
* Copying a File
* Deleting Files
* Using Files to Manage Configuration
## [22. Introducing Regular Expressions][22]
* Defining Regular Expressions
* Getting Familiar with Regular Expression Syntax
* How To Validate Data Using Regular Expressions
* Using Regular Expressions for Validation
* Using Regular Expressions to Transform Data
* Parsing Data with Regular Expressions
## [23. Time][23]
* Programming the Element of Time
* Putting Your Program to Sleep
* Setting a Timeout
* Using a Ticker
* Representing Time in a String format
* Working with Time structs
* Adding and Subtracting Time
* Comparing Different Time Structs
## [24. Deployment][24]
* Understanding targets
* Reducing the Size of Binaries
* Using Docker
* Downling Binary Files
* Using go get
* Releasing Code with Package Managers
## [25. Creating a RESTful JSON API][25]
* Managing Dependencies with dep
* Creating a HTTP Server with httprouter
* Scaffolding a REST API
* Testing HTTP Routes
* Serving JSON
* Adding Data Persistence
## [26. Creating a TCP Chat Server][26]
* What is TCP?
* Using telnet
* Using the net Package
* Creating a Simple Chat Server
* Managing Client Connections
* Enabling Messaging Between Clients
* Preventing Echoes
[1]: hour01
[2]: hour02
[3]: hour03
[4]: hour04
[5]: hour05
[6]: hour06
[7]: hour07
[8]: hour08
[9]: hour09
[10]: hour10
[11]: hour11
[12]: hour12
[13]: hour13
[14]: hour14
[15]: hour15
[16]: hour16
[17]: hour17
[18]: hour18
[19]: hour19
[20]: hour20
[21]: hour21
[22]: hour22
[23]: hour23
[24]: hour24
[25]: hour25
[26]: hour26
近期下载者:
相关文件:
收藏者: