Skip to content

Instantly share code, notes, and snippets.

@lalizita
Created November 2, 2022 00:22
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 lalizita/c93f62d140218d9015ff0d01aea0b3f9 to your computer and use it in GitHub Desktop.
Save lalizita/c93f62d140218d9015ff0d01aea0b3f9 to your computer and use it in GitHub Desktop.
Example of anonymous function with go for a medium article
func main() {
func() {
fmt.Println("HIIIIIII!")
}()
func(name string) {
fmt.Printf("Hello %s", name)
}("Maria")
}
// OUTPUT
// HIIIIIII!
// Hello Maria
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment