My first dev.to post “Calling Swift from Go” describes how to use a C library as middleware between Swift and Go, on order to call a Swift function from a Go program.

My goal was to write a very simple command line tool that can generate one-time passwords compatible with Google Authenticator. Google authenticator uses the Time-based One-Time Password algorithm (TOTP) to generate codes. Instead of writing my own implementation, I wanted to use an existing TOTP library, since there already are many good ones. This is how I came to write a simple tool.. 3 times, in different languages. My choice was to experiment with C, Go and Swift.

Read more in this Medium post.