vkorbes / aprendago

Curso completo em português da linguagem Go, de zero a ninja! 🇧🇷
http://aprendago.com
991 stars 180 forks source link

Exercício: Capítulo 20, Exercício 7 (Nível: 9) #65

Open vkorbes opened 3 years ago

vkorbes commented 3 years ago

Exercício: Capítulo 20, Exercício 7 (Nível: 9)

Link para o vídeo:

Use esta thread para compartilhar sua solução, discutir o exercício com os colegas e pedir ajuda caso tenha dificuldades!

an4kein commented 3 years ago

LOL meu video up sobre func

https://youtu.be/rI-Lzvg2ICo

package main

import "fmt"

//func (receiver) nome(params) (returns) { code }

func funcaotal() {
    fmt.Println("Funcao nova: 1337")
}

func funcaoRecebe(x int) {
    fmt.Println("seraaaaaaaaaaaaA?")
}

func funcaoRetorno(x int) int {
    fmt.Println(x)
    return x
}

func soma() func(x, y int) int {
    return func(x, y int) int {
        total := x + y
        fmt.Println("TOTAL:\t", total)
        return total
    }
}

func main() {
    fmt.Println("anakein")
    funcaotal()
    funcaoRecebe(10)
    funcaoRetorno(133)
    soma()(500, 500)
    func() {
        fmt.Println("esqueci essa anon")
    }()

}

Output

image

wfrsilva commented 2 years ago

Algumas gambiarras e perrengues com GO x Windows https://youtu.be/bCP0q-on6VU image