for JavaScript Developers
Scott Ernst
/sernst/GoIntro
$ go get ...
$ npm install ...
require('path')
import "path"
Good Looks
Pleasant Demeanor
Confidence
Athletic Ability
http://golang-for-python-programmers.readthedocs.org/en/latest/intro.html
• Statically typed
• Compiled
• C/Java syntax family
• Functional (closures & first class functions)
• Pointers (simplified compared to C)
• Concurrency
/sernst/GoIntro
Example:
Define functions
Pass variables
Print to console
Explicit type conversions
Example:
Define variables
Uninitialized "zero" values
Functions that return values
Closures
Functions as variables
Example:
Define and populate arrays
Passing by copy versus by reference
Go slices like JavaScript arrays
Example:
Define and populate maps/objects
Modifying by reference
Example:
Example:
Example: