closures-in-go

command module
v0.0.0-...-35884d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 0 Imported by: 0

README

Closures in Go

What are closures?

  • Wikipedia mentions: "a closure is a technique for implementing lexically scoped name binding in a language with first-class functions."

What does that mean?

  • We may write functions with access to the current scope, put the function in a variable, and pass it to a different part of the application that normally doesn't have access.

Why bother?

  • Create methods that have asynchronous operation.
  • Send local objects to remote places. Examples are e.g. database handles or logging instances.

Repository examples are in pkg/

Real world examples

  • Naiserator is a Kubernetes operator written by NAV. It manages Kubernetes resources using a create, update or delete mechanism implemented with closures.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL