Skip to content

Instantly share code, notes, and snippets.

@rahul-yr
Created June 21, 2022 15:45
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 rahul-yr/eaf3e7ac78f72849b3d234affabfb573 to your computer and use it in GitHub Desktop.
Save rahul-yr/eaf3e7ac78f72849b3d234affabfb573 to your computer and use it in GitHub Desktop.
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