Inspiration
To explore and learn a new language
What it does
A program to find the Fibonacci numbers in Go Language
How we built it
First we went through the official documentation and wrote the code
Code
package main import "fmt" // fib returns a function that returns // successive Fibonacci numbers. func fib() func() int { a, b := 0, 1 return func() int { a, b = b, a+b return a } } func main() { f := fib() // Function calls are evaluated left-to-right. fmt.Println(f(), f(), f(), f(), f()) }
Output
1 1 2 3 5
Program exited.
Challenges we ran into
Learning a new language is definitely challenging, but we also enjoyed exploring the new language.
Accomplishments that we're proud of
To be able to write programs in GO
What we learned
To write simple programs in Go
What's next for Exploring Go
Learning more about the language and its syntax.
Log in or sign up for Devpost to join the conversation.