/plushcap/analysis/cloudflare/setting-go-variables-at-compile-time

Setting Go variables from the outside

What's this blog post about?

Filippo Valsorda from CloudFlare discusses the use of the -X linker option in Go programming to embed version numbers into binaries. The -X option sets the value of a string variable in the linked Go program and can be used with the -ldflags option. An example is provided where the who variable's value is changed from "World" to "CloudFlare". This method works even when using external linking, such as cgo. The author also mentions that CloudFlare is hiring in London, San Francisco, and Singapore for those interested in working with experienced Go developers.

Company
Cloudflare

Date published
July 1, 2015

Author(s)
Filippo Valsorda

Word count
456

Hacker News points
None found.

Language
English


By Matt Makai. 2021-2024.