Skip to content

Commit

Permalink
14.9 - funcao init
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruteski committed Mar 31, 2024
1 parent 5e458c2 commit a5be7bc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 14-funcoes_avacadas/14.9-funcao_init/funcao_init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import "fmt"

// funcao init - 1 por arquivo
var n int

func init() {
fmt.Println("Funcao init sendo executada")
n = 10
}

func main() {
fmt.Println("Funcao main sendo executada")
fmt.Println(n)
}

0 comments on commit a5be7bc

Please sign in to comment.