Skip to content

Commit

Permalink
14.3 funcoes anonimas
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruteski committed Mar 27, 2024
1 parent a278c07 commit 63ddae6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions 14-funcoes_avacadas/14.3-funcoes_anonimas/funcoes_anonimas.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import "fmt"

func main() {
func() {
fmt.Println("Ola mundo")
}()

func(texto string) {
fmt.Println(texto)
}("passando parametro")

retorno := func(texto string) string {
return fmt.Sprintf("Recebido -> %s", texto)
}("retornando algo")

fmt.Println(retorno)
}

0 comments on commit 63ddae6

Please sign in to comment.