The Coderpad Starter
Comments
// To execute Go code, please declare a func main() in a
The Main Func
func main() {
}
Package
package main
Imports
import "fmt"
Logging Text to the Console
fmt.Println("Derp!");
For Loops
for i := 0; i < 5; i++ { fmt.Println("Hello, World!") }
All Together Now!
// To execute Go code, please declare a func main() in a package "main" package main import "fmt" func main() { for i := 0; i < 5; i++ { fmt.Println("Hello, World!") } }
Bonus: Calling Functions!
func main() { derp(); } func derp() { fmt.Println("Derp!"); }