DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Kelvin Wangonya
Kelvin Wangonya

Posted on • Originally published at wangonya.com

Getting the running Go version

This would mostly be useful for debugging.

package main

import (
    "log"
    "runtime"
)

func main() {
    log.Printf("Running Go: %s", runtime.Version())
}
Enter fullscreen mode Exit fullscreen mode

Output: Running Go: go1.16.6

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.