Chang Sau / Чанг Сау - Go Cookbook / Книга рецептов Go [2023, PDF, EPUB, MOBI, ENG]

Страницы:  1
Ответить
 

tsurijin

Стаж: 5 лет 8 месяцев

Сообщений: 3246


tsurijin · 25-Сен-23 07:20 (2 года 10 месяцев назад, ред. 27-Ноя-23 13:27)

Go Cookbook / Книга рецептов Go
Год издания: 2023
Автор: Chang Sau / Чанг Сау
Издательство: O’Reilly
ISBN: 978-1-098-12211-9
Язык: Английский
Формат: PDF, EPUB, MOBI
Качество: Издательский макет или текст (eBook)
Количество страниц: 370
Описание: Go is an increasingly popular language for programming everything from web applications to distributed network services. This practical guide provides recipes to help you unravel common problems and perform useful tasks when working with Go. Each recipe includes self-contained code solutions that you can freely use, along with a discussion of how and why they work. Programmers new to Go can quickly ramp up their knowledge while accomplishing useful tasks, and experienced Go developers can save time by cutting and pasting proven code directly into their applications.
Recipes include:
Creating a module
Calling code from another module
Returning and handling an error
Converting strings to numbers (or converting numbers to strings)
Modifying multiple characters in a string
Creating substrings from a string
Capturing string input
And so much more
Go становится все более популярным языком для программирования всего - от веб-приложений до распределенных сетевых сервисов. В этом практическом руководстве приведены рецепты, которые помогут вам разобраться с распространенными проблемами и выполнять полезные задачи при работе с Go. Каждый рецепт включает в себя автономные кодовые решения, которые вы можете свободно использовать, а также обсуждение того, как и почему они работают. Программисты, новички в Go, могут быстро расширить свои знания, выполняя полезные задачи, а опытные разработчики Go могут сэкономить время, вырезая и вставляя проверенный код непосредственно в свои приложения.
Рецепты включают в себя:
Создание модуля
Вызывающий код из другого модуля
Возврат и обработка ошибки
Преобразование строк в числа (или преобразование чисел в строки)
Изменение нескольких символов в строке
Создание подстрок из строки
Захват строкового ввода
И многое другое
Внимание! Торрент перезалит. Просьба перекачать раздачу.
Причина: Замена файлов.
Примеры страниц
[/URL]
Оглавление
Preface xi
1. Getting Started Recipes 1
1.0 Introduction 1
1.1 Installing Go 1
1.2 Playing Around with Go 3
1.3 Writing a Hello World Program 4
1.4 Using an External Package 5
1.5 Handling Errors 7
1.6 Logging Events 9
1.7 Testing Your Code 10
2. Module Recipes 13
2.0 Introduction 13
2.1 Creating a Go Module 14
2.2 Importing Dependent Packages Into Your Module 15
2.3 Removing Dependent Packages from Your Module 18
2.4 Find Available Versions of Third-Party Packages 19
2.5 Importing a Specific Version of a Dependent Package Into Your Module 20
2.6 Requiring Local Versions of Dependent Packages 22
2.7 Using Multiple Versions of the Same Dependent Packages 26
3. Error Handling Recipes 29
3.0 Introduction 29
3.1 Handling Errors 30
3.2 Simplifying Repetitive Error Handling 32
3.3 Creating Customized Errors 34
3.4 Wrapping an Error with Other Errors 36
3.5 Inspecting Errors 37
3.6 Handling Errors with Panic 39
3.7 Recovering from Panic 41
3.8 Handling Interrupts 43
4. Logging Recipes 45
4.0 Introduction 45
4.1 Writing to Logs 45
4.2 Change What Is Being Logged by the Standard Logger 48
4.3 Logging to File 49
4.4 Using Log Levels 50
4.5 Logging to the System Log Service 53
5. Function Recipes 57
5.0 Introduction 57
5.1 Defining a Function 57
5.2 Accepting Multiple Data Types with a Function 59
5.3 Accepting a Variable Number of Parameters 61
5.4 Accepting Parameters of Any Type 62
5.5 Creating an Anonymous Function 65
5.6 Creating a Function That Maintains State After It Is Called 66
6. String Recipes 71
6.0 Introduction 71
6.1 Creating Strings 71
6.2 Converting String to Bytes and Bytes to String 73
6.3 Creating Strings from Other Strings and Data 73
6.4 Converting Strings to Numbers 77
6.5 Converting Numbers to Strings 79
6.6 Replacing Multiple Characters in a String 81
6.7 Creating a Substring from a String 84
6.8 Checking if a String Contains Another String 85
6.9 Splitting a String Into an Array of Strings or Combining an Array of
Strings Into a String 86
6.10 Trimming Strings 88
6.11 Capturing String Input from the Command Line 89
6.12 Escaping and Unescaping HTML Strings 91
6.13 Using Regular Expressions 92
7. General Input/Output Recipes 97
7.0 Introduction 97
7.1 Reading from an Input 98
7.2 Writing to an Output 99
7.3 Copying from a Reader to a Writer 100
7.4 Reading from a Text File 102
7.5 Writing to a Text File 104
7.6 Using a Temporary File 106
8. CSV Recipes 109
8.0 Introduction 109
8.1 Reading the Whole CSV File 110
8.2 Reading a CSV File One Row at a Time 111
8.3 Unmarshalling CSV Data Into Structs 112
8.4 Removing the Header Line 113
8.5 Using Different Delimiters 113
8.6 Ignoring Rows 114
8.7 Writing CSV Files 115
8.8 Writing to File One Row at a Time 116
9. JSON Recipes 117
9.0 Introduction 117
9.1 Parsing JSON Data Byte Arrays to Structs 117
9.2 Parsing Unstructured JSON Data 121
9.3 Parsing JSON Data Streams Into Structs 124
9.4 Creating JSON Data Byte Arrays from Structs 131
9.5 Creating JSON Data Streams from Structs 133
9.6 Omitting Fields in Structs 136
10. Binary Recipes 139
10.0 Introduction 139
10.1 Encoding Data to gob Format Data 140
10.2 Decoding gob Format Data to Structs 141
10.3 Encoding Data to a Customized Binary Format 144
10.4 Decoding Data with a Customized Binary Format to Structs 147
11. Date and Time Recipes 151
11.0 Introduction 151
11.1 Telling Time 152
11.2 Doing Arithmetic with Time 152
11.3 Representing Dates 153
11.4 Representing Time Zones 154
11.5 Representing Duration 155
11.6 Pausing for a Specific Duration 156
11.7 Measuring Lapsed Time 156
11.8 Formatting Time for Display 159
11.9 Parsing Time Displays Into Structs 163
12. Structs Recipes 167
12.0 Introduction 167
12.1 Defining Structs 168
12.2 Creating Struct Methods 170
12.3 Creating and Using Interfaces 172
12.4 Creating Struct Instances 175
12.5 Creating One-Time Structs 178
12.6 Composing Structs from Other Structs 181
12.7 Defining Metadata for Struct Fields 184
13. Data Structure Recipes 187
13.0 Introduction 187
13.1 Creating Arrays or Slices 188
13.2 Accessing Arrays or Slices 190
13.3 Modifying Arrays or Slices 192
13.4 Making Arrays and Slices Safe for Concurrent Use 195
13.5 Sorting Arrays of Slices 198
13.6 Creating Maps 202
13.7 Accessing Maps 203
13.8 Modifying Maps 204
13.9 Sorting Maps 205
14. More Data Structure Recipes 207
14.0 Introduction 207
14.1 Creating Queues 208
14.2 Creating Stacks 210
14.3 Creating Sets 212
14.4 Creating Linked Lists 216
14.5 Creating Heaps 221
14.6 Creating Graphs 225
14.7 Finding the Shortest Path on a Graph 229
15. Image-Processing Recipes 235
15.0 Introduction 235
15.1 Loading an Image from a File 237
15.2 Saving an Image to a File 238
15.3 Creating Images 239
15.4 Flipping an Image Upside Down 240
15.5 Converting an Image to Grayscale 243
15.6 Resizing an Image 245
16. Networking Recipes 247
16.0 Introduction 247
16.1 Creating a TCP Server 248
16.2 Creating a TCP Client 252
16.3 Creating a UDP Server 254
16.4 Creating a UDP Client 256
17. Web Recipes 259
17.0 Introduction 259
17.1 Creating a Simple Web Application 260
17.2 Handling HTTP Requests 263
17.3 Handling HTML Forms 266
17.4 Uploading a File to a Web Application 268
17.5 Serving Static Files 269
17.6 Creating a JSON Web Service API 274
17.7 Serving Through HTTPS 276
17.8 Using Templates for Go Web Applications 280
17.9 Making an HTTP Client Request 285
18. Testing Recipes 291
18.0 Introduction 291
18.1 Automating Functional Tests 292
18.2 Running Multiple Test Cases 293
18.3 Setting Up and Tearing Down Before and After Tests 295
18.4 Creating Subtests to Have Finer Control Over Groups of Test Cases 297
18.5 Running Tests in Parallel 301
18.6 Generating Random Test Inputs for Tests 306
18.7 Measuring Test Coverage 312
18.8 Testing a Web Application or a Web Service 316
19. Benchmarking Recipes 319
19.0 Introduction 319
19.1 Automating Performance Tests 319
19.2 Running Only Performance Tests 321
19.3 Avoiding Test Fixtures in Performance Tests 322
19.4 Changing the Timing for Running Performance Tests 325
19.5 Running Multiple Performance Test Cases 327
19.6 Comparing Performance Test Results 329
19.7 Profiling a Program 332
Index 341
Download
Сайт не распространяет и не хранит электронные версии произведений, а лишь предоставляет доступ к создаваемому пользователями каталогу ссылок на торрент-файлы, которые содержат только списки хеш-сумм
Как скачивать? (для скачивания .torrent файлов необходима регистрация)
[Профиль]  [ЛС] 
 
Ответить
Loading...
Error