Forgiveness in the body, heart, and mind comes from kind and good hearted actions in the form of breath, exercise and service.
(Go Lang) Functions (GBEN)
Example
- Like
Cwith some type inference - Ignore the lambda expression usage, this is just so I can run the code easily in a single source block
(Go Lang) Range (GBEN)
Example
- Iterate over things and do something
(Go Lang) Maps (GBEN)
Example
- Maps are maps
- Getter returns a second result, a boolean, telling of the key was present
(Go Lang) Slices (GBEN)
Example
- Typed collections
- Similar declaraction syntax
- Bunch of associated functions
(Go Lang) Arrays (GBEN)
Example
- Like
Cdeclaration and index referencing and default values andlenand multi-dimensional - declaration of, inference and assignment to
b := [5]int{1, 2, 3, 4, 5}
- Not used much because yet to be explained
slicesare better
(Go Lang) Switch (GBEN)
Example
- Like C
- switch / case / default
- Multiple comma separated conditions per case
- case on interface type
- Interface types not yet introduced
(Go Lang) If/Else (GBEN)
Example
- Just like in
C- But with let-like bindings in declaration
- So last line would generate an error because num is out of scope
- But with let-like bindings in declaration
- No ternary
(Go Lang) For (GBEN)
Example
- Only looping construct
- Same as in
C
(Go Lang) Constants (GBEN)
Example
- Typical constants
constkeyword can appear anywhere, maybe declaring a type- Type given by explicit cast or use in context
