Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Cap. 12 – Funções – 10. Closure
Play lesson

Aprenda Go 🇧🇷 - Cap. 12 – Funções – 10. Closure

5.0 (2)
47 learners

What you'll learn

This course includes

  • 21.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Aprenda Go 🇧🇷 Cap. 12 – Funções – 10. Closure

Cap. 12 – Funções – 10. Closure Transcript and Lesson Notes

- Closure é cercar ou capturar um scope para que possamos utilizá-lo em outro contexto. Já vimos: - Package-level scope - Function-level scope - Code-block-in-code-block scope - Exemplo de closure: - func i() func() int

Quick Summary

- Closure é cercar ou capturar um scope para que possamos utilizá-lo em outro contexto. Já vimos: - Package-level scope - Function-level scope - Code-block-in-code-block scope - Exemplo de closure: - func i() func() int

Key Takeaways

  • Review the core idea: - Closure é cercar ou capturar um scope para que possamos utilizá-lo em outro contexto. Já vimos: - Package-level scope - Function-level scope - Code-block-in-code-block scope - Exemplo de closure: - func i() func() int
  • Understand how programar fits into Cap. 12 – Funções – 10. Closure.
  • Understand how golang fits into Cap. 12 – Funções – 10. Closure.
  • Understand how programação fits into Cap. 12 – Funções – 10. Closure.
  • Understand how programacao fits into Cap. 12 – Funções – 10. Closure.

Key Concepts

Full Transcript

- Closure é cercar ou capturar um scope para que possamos utilizá-lo em outro contexto. Já vimos: - Package-level scope - Function-level scope - Code-block-in-code-block scope - Exemplo de closure: - func i() func() int { x := 0; return func() int { x++; return x } } - Quando fizermos a := i() teremos um scope, um valor para x. - Quando fizermos b := i() teremos outro scope, e x terá um valor independente do x acima. - Closures nos permitem salvar dados entre function calls e ao mesmo tempo isolar estes dados do resto do código. - Go Playground: https://play.golang.org/p/AdFciYwI2Z

Lesson FAQs

What is Cap. 12 – Funções – 10. Closure about?

- Closure é cercar ou capturar um scope para que possamos utilizá-lo em outro contexto. Já vimos: - Package-level scope - Function-level scope - Code-block-in-code-block scope - Exemplo de closure: - func i() func() int

What key concepts are covered in this lesson?

The lesson covers programar, golang, programação, programacao, go.

What should I learn before Cap. 12 – Funções – 10. Closure?

Review the previous lessons in Aprenda Go 🇧🇷, then use the transcript and key concepts on this page to fill any gaps.

How can I practice after this lesson?

Practice by applying the main concepts: programar, golang, programação, programacao.

Does this lesson include a transcript?

Yes. The full transcript is visible on this page in indexable HTML sections.

Is this lesson free?

Yes. CourseHive lessons and courses are available to learn online for free.

Continue Learning

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Lessons

Related Courses

FAQs

Course Hive
Download CourseHive and keep learning anywhere
Get App