Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Practical Systems Programming in Go
  • Table Of Contents Toc
Practical Systems Programming in Go

Practical Systems Programming in Go

By : Mihalis Tsoukalos
close
close
Practical Systems Programming in Go

Practical Systems Programming in Go

By: Mihalis Tsoukalos

Overview of this book

Go has become a leading language for Systems Programming thanks to its simplicity, strong concurrency model, and excellent performance. Practical Systems Programming in Go shows how to use Go beyond application development by building software that interacts with the operating system, networks, and data at scale. The book starts with a focused introduction to Go, covering the language features and standard packages most relevant to systems programming, including those handling concurrency, interfaces, testing, and runtime internals. It then moves into essential system-level topics such as file handling and I/O, UNIX signals, file systems, structured data formats, databases, and TCP/IP networking. Readers build practical command-line tools, web services, and network clients and servers along the way. In the final section, the book explores advanced applications, including writing an interpreter for a small programming language, processing time series data, building data-mining tools, and creating efficient indexes for UNIX file systems. By the end, readers will be able to design and implement robust systems software in Go for real-world environments.
Table of Contents (21 chapters)
close
close
Lock Free Chapter
1
Part 1: A quick introduction to Go
6
Part 2: Systems Programming Essentials
12
Part 3: Applications
20
Index

Writing files

Writing files is a fundamental operation in Go that allows programs to store data permanently on disk. Whether you need to save configuration settings, generate reports, or log application activity, the Go standard library provides straightforward and flexible tools for writing data to files. By choosing the right file-opening modes, you can control whether you overwrite existing content, append new data, or create files only if they do not already exist. Once you have a file handle, you can write data with methods such as f.Write(), which accepts a byte slice, or f.WriteString(), which accepts a string directly. For more efficient output, the bufio.NewWriter() type can wrap a file handle and perform buffer writes before flushing them with w.Flush(). Once you understand the basics of writing files in Go, the next step is to handle situations where you want to add new data to an existing file without overwriting its current contents. So, to kick things off, let's see...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Practical Systems Programming in Go
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon