Go Programming World
Author

Go Programming World

Mobile version of tech blog https://jianghushinian.cn/, covering Golang, Docker, Kubernetes and beyond.

66
Articles
0
Likes
187
Views
0
Comments
Recent Articles

Latest from Go Programming World

66 recent articles
Go Programming World
Go Programming World
May 5, 2024 · Backend Development

Using pflag for Command-Line Argument Parsing in Go

This article introduces the Go third‑party flag package pflag, detailing its POSIX/GNU‑style features, basic and advanced usage, flag syntax, name normalization, NoOptDefVal handling, deprecation/hiding mechanisms, and how to mix it with the standard flag package.

Command LineGolangflag parsing
0 likes · 17 min read
Using pflag for Command-Line Argument Parsing in Go
Go Programming World
Go Programming World
May 2, 2024 · Backend Development

Comprehensive Guide to Using Viper for Go Application Configuration

This article provides an in‑depth tutorial on Viper, a full‑featured Go configuration library, covering its features, usage scenarios, loading priorities, reading from files, environment variables, command‑line flags, remote stores, and best practices for managing application settings.

DevOpsGoRemote Config
0 likes · 22 min read
Comprehensive Guide to Using Viper for Go Application Configuration
Go Programming World
Go Programming World
Apr 30, 2024 · Backend Development

A Comprehensive Guide to Using Uber's Zap Logging Library in Go

This article introduces Uber's open‑source Zap library for Go, explains its high‑performance, structured, leveled logging features, demonstrates basic and advanced usage with code examples, compares production and development configurations, shows how to use SugaredLogger, customize loggers, apply options, and integrate the library into custom logging packages.

GoStructured LoggingSugaredLogger
0 likes · 19 min read
A Comprehensive Guide to Using Uber's Zap Logging Library in Go
Go Programming World
Go Programming World
Feb 19, 2024 · Backend Development

Implementing Context Managers in Go: Emulating Python's with Using defer and Anonymous Functions

This article explores how to replicate Python's context manager behavior in Go by examining defer's delayed execution, demonstrating its limitations in loops, and presenting three solutions—anonymous functions, a WithClose helper, and a withLock-inspired pattern—to ensure timely resource release.

GoWithCloseanonymous function
0 likes · 10 min read
Implementing Context Managers in Go: Emulating Python's with Using defer and Anonymous Functions