Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Network Automation with Go

You're reading from   Network Automation with Go Learn how to automate network operations and build applications using the Go programming language

Arrow left icon
Product type Paperback
Published in Jan 2023
Publisher Packt
ISBN-13 9781800560925
Length 442 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Michael Kashin Michael Kashin
Author Profile Icon Michael Kashin
Michael Kashin
Nicolas Leiva Nicolas Leiva
Author Profile Icon Nicolas Leiva
Nicolas Leiva
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Part 1: The Go Programming Language
2. Chapter 1: Introduction FREE CHAPTER 3. Chapter 2: Go Basics 4. Chapter 3: Getting Started with Go 5. Chapter 4: Networking (TCP/IP) with Go 6. Part 2: Common Tools and Frameworks
7. Chapter 5: Network Automation 8. Chapter 6: Configuration Management 9. Chapter 7: Automation Frameworks 10. Part 3: Interacting with APIs
11. Chapter 8: Network APIs 12. Chapter 9: OpenConfig 13. Chapter 10: Network Monitoring 14. Chapter 11: Expert Insights 15. Chapter 12: Appendix : Building a Testing Environment 16. Index 17. Other Books You May Enjoy

Debugging Go programs

Reading and reasoning about an existing code base is a laborious task, and it gets even harder as programs mature and evolve. This is why, when learning a new language, it’s very important to have at least a basic understanding of the debugging process. Debugging allows us to halt the execution of a program at a pre-defined place and step through the code line by line while examining in-memory variables and data structures.

In the following example, we use Delve to debug the packet-capture program we just ran. Before you can start, you need to generate some traffic through the lab topology with make traffic-start:

$ make traffic-start
docker exec -d clab-netgo-cvx systemctl restart hsflowd
docker exec -d clab-netgo-host-3 ./ethr -s
docker exec -d clab-netgo-host-1 ./ethr -c 203.0.113.253 -b 900K -d 60s -p udp -l 1KB
docker exec -d clab-netgo-host-1 ./ethr -c 203.0.113.252 -b 600K -d 60s -p udp -l 1KB
docker exec -d clab-netgo-host-1 ./ethr -c 203...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime