Coding Through the Alphabet - Fibonacci in Go
Go (also known as Golang) is an open-source programming language created by Google. It is statically typed, compiled, and designed for simplicity and efficiency.
How to test
Prerequisites: Go
- Ubuntu/Debian:
sudo apt install golang-go - macOS:
brew install go - All platforms: https://go.dev/dl/
go run fibonacci.go
Expected output:
0
1
1
2
3
5
8
13
21
34
Source Code
package main
import "fmt"
func main() {
a, b := 0, 1
for i := 0; i < 10; i++ {
fmt.Println(a)
a, b = b, a+b
}
}
Local Testing Screenshot
