Skip to content

Instantly share code, notes, and snippets.

@fmoor
Created September 15, 2020 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmoor/538ee60a3ff787d267ba9b75c883247a to your computer and use it in GitHub Desktop.
Save fmoor/538ee60a3ff787d267ba9b75c883247a to your computer and use it in GitHub Desktop.
A cli tool to generate Fibonacci numbers.
// A cli tool to generate Fibonacci numbers.
package main
import "fmt"
func main() {
var a, b uint64 = 0, 1
for a <= b {
fmt.Println(a)
a, b = b, a+b
}
// don't miss the last number in the sequence before overflowing uint64
fmt.Println(a)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment