There is a bug in golang/glog that the CGO condition is wrong.
//go:build linux
//go:build !(unix || windows)
On the Linux platform, the function will be declared twice. The problem is actually caused by the wrong CGO conditions, instead of the low Go version.
GOOS=linux ~/go1.18/bin/go build -o exe ./example/main.go
note: module requires Go 1.19
The correct condition should be:
//go:build !(unix || windows || linux)
Because you already have glog_file_linux.go