Category: Go

Jun 15, 2023

Go sync.Mutex 的实现原理

Go语言的sync.Mutex通过状态变量和原子操作实现线程间的互斥锁,确保共享资源的线程安全访问。

Read more
Jun 15, 2023

Go 接受 os.Interrupt

在Go中,使用`os/signal`包可以捕获并处理`os.Interrupt`和`syscall.SIGTERM`信号,如示例程序所示。

Read more
Jun 14, 2023

Gomobile is a tool for building and running mobile apps written in Go.

Gomobile enables Go developers to write and cross-compile a single codebase for iOS and Android, utilizing Go's syntax and libraries, while providing APIs for mobile features and generating bindings for foreign language libraries.

Read more
Jun 14, 2023

Go 程序中使用 cgo 什么是 cgo?

cgo是一个Go语言包,它简化了Go程序与C函数之间的互操作,允许双向调用并提高了效率。

Read more
Jun 14, 2023

cgo 环境的配置

在Linux系统上配置cgo环境需要安装GCC编译器、配置环境变量、安装CGO头文件和库文件,然后编译运行包含cgo代码的Go程序。

Read more
PreviousNext