Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Addition program in go
package main
import (
"log"
"time"
)
// addTwoNumbers adds two numbers together and prints the result
func addTwoNumbers(a int, b int) {
// sleep for a second to simulate a long running operation
time.Sleep(2 * time.Second)
log.Println("Result:", a+b)
}
// main is the entry point for the program
func main() {
// call addTwoNumbers with two numbers
addTwoNumbers(1, 2)
log.Println("Done")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment