Жанры
Авторы
Контакты
О сайте
Книжные новинки
Популярные книги
Найти
Главная
Авторы
Amit Saha
Practical Go
Читать книгу Practical Go - Amit Saha - Страница 1
Оглавление
Предыдущая
Следующая
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
67
Оглавление
Купить и скачать книгу
Вернуться на страницу книги Practical Go
Оглавление
Страница 1
Table of Contents
List of Tables
List of Illustrations
Guide
Pages
Страница 7
Страница 8
Страница 9
Getting Started
Installing Go
Choosing an Editor
Installing Protocol Buffer Toolchain
Linux and macOS
Windows
Installing Docker Desktop
Guide to the Book
Go Modules
Command Line and Terminals
Terms
Robustness and Resiliency
Production Readiness
Reference Documentation
Go Refresher
Struct Type
Interface Type
Goroutines and Channels
Testing
Summary
CHAPTER 1 Writing Command-Line Applications
Your First Application
Listing 1.1
: A greeter application
Writing Unit Tests
Listing 1.2
: Test for the
parseArgs()
function
Listing 1.3
: Test for the
validateArgs()
function
Listing 1.4
: Test for the
runCmd()
function
Using the Flag Package
Listing 1.5
: Greeter using
flag
Testing the Parsing Logic
Listing 1.6
: Test for the
parseArgs()
function
Improving the User Interface
Removing Duplicate Error Messages
Customizing Usage Message
Accept Name via a Positional Argument
Listing 1.7
: Greeter program with user interface updates
Updating the Unit Tests
Listing 1.8
: Test for
parseArgs()
function
Listing 1.9
: Test for
runCmd()
function
Summary
CHAPTER 2 Advanced Command-Line Applications
Implementing Sub-commands
Listing 2.1
: Implementing sub-commands in a command-line application
An Architecture for Sub-command-Driven Applications
Listing 2.2
: Implementation of the
main
package
Listing 2.3
: Implementation of the
HandleHttp()
function
Listing 2.4
: Implementation of the
HandleGrpc()
function
Listing 2.5
: Custom error values
Testing the Main Package
Listing 2.6
: Unit test for the
main
package
Testing the Cmd Package
Making Your Applications Robust
User Input with Deadlines
Listing 2.7
: Implementing time-out for user input
Handling User Signals
Listing 2.8
: Handling user signals
Summary
{buyButton}
Подняться наверх