<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>go | rael.io</title><link>https://rael.io/tags/go/</link><atom:link href="https://rael.io/tags/go/index.xml" rel="self" type="application/rss+xml"/><description>go</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>Fork me on [GitHub](https://github.com/raelga/rael.io)</copyright><lastBuildDate>Wed, 18 Sep 2019 18:30:00 +0200</lastBuildDate><image><url>https://rael.io/img/photos/emma-hello-card.jpg</url><title>go</title><link>https://rael.io/tags/go/</link></image><item><title>Extending the Kubernetes API with Custom Resources, Controllers and Operators</title><link>https://rael.io/talk/cnbcn-extending-k8s/</link><pubDate>Wed, 18 Sep 2019 18:30:00 +0200</pubDate><guid>https://rael.io/talk/cnbcn-extending-k8s/</guid><description>
&lt;p&gt;What is the controller pattern? And the operator pattern? How we can use custom controllers to extend the Kubernetes API? How we can build our own custom resources, controllers and operators?&lt;/p&gt;
&lt;p&gt;Join at &lt;a href=&#34;https://www.meetup.com/Cloud-Native-Barcelona/events/264074481/&#34; target=&#34;_blank&#34;&gt;meetup.com/Cloud-Native-Barcelona&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Slides at &lt;a href=&#34;https://go.rael.dev/cnbcn-extending-k8s&#34; target=&#34;_blank&#34;&gt;go.rael.dev/cnbcn-extending-k8s&lt;/a&gt;
The talk will be streamed live at &lt;a href=&#34;https://glovoapp.zoom.us/j/364754734&#34; target=&#34;_blank&#34;&gt;https://glovoapp.zoom.us/j/364754734&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2 id=&#34;agenda&#34;&gt;Agenda&lt;/h2&gt;
&lt;h3 id=&#34;18-30-welcome&#34;&gt;18:30 Welcome&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Introduction to the Cloud Native community and Glovo!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&#34;18-45-kubernetes-architecture&#34;&gt;18:45 Kubernetes Architecture&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Introduction to the core principles an components of the Kubernetes architecture. We will start a Kubernetes cluster from scratch, component by component learning how each piece fits into the puzzle.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/raelga/kubernetes-talks/tree/master/k8s-from-scratch&#34; target=&#34;_blank&#34;&gt;github.com/raelga/kubernetes-talks/tree/master/k8s-from-scratch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;
&lt;iframe src=&#34;//www.youtube.com/embed/zFqQb1e2jO4&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; allowfullscreen title=&#34;YouTube Video&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;h3 id=&#34;19-40-break&#34;&gt;19:40 Break&lt;/h3&gt;
&lt;h3 id=&#34;19-45-kubernetes-custom-controllers-and-operators-in-action&#34;&gt;19:45 Kubernetes Custom Controllers and Operators in action&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Introduction to the Operator concept. We will deploy some operators in a Google Kubernetes Engine cluster step by step and build our own Operator without (almost) writing any code.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;github.com/raelga/extending-kubernetes/tree/master/labs/ansible-operators&#34; target=&#34;_blank&#34;&gt;github.com/raelga/extending-kubernetes/tree/master/labs/ansible-operators&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;github.com/raelga/extending-kubernetes/tree/master/labs/operators-and-custom-controllers&#34; target=&#34;_blank&#34;&gt;github.com/raelga/extending-kubernetes/tree/master/labs/operators-and-custom-controllers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;20-30-pizza-and-drinks-from-glovo&#34;&gt;20:30 Pizza and drinks from Glovo!&lt;/h3&gt;
&lt;hr /&gt;
&lt;h2 id=&#34;speakers&#34;&gt;Speakers&lt;/h2&gt;
&lt;h3 id=&#34;nacho-alonso&#34;&gt;Nacho Alonso&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;SRE at CAPSiDE, contributor at Kubernetes and co-organizer at Cloud Native Barcelona&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&#34;rael-garcia&#34;&gt;Rael Garcia&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;SRE at CAPSiDE, contributor at Kubernetes and organizer at Cloud Native Barcelona&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&#34;roi-vázquez&#34;&gt;Roi Vázquez&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;SRE at CAPSiDE and contributor at Kubernetes &lt;a href=&#34;github.com/lominorama&#34; target=&#34;_blank&#34;&gt;@lominorama&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&#34;sergio-lópez&#34;&gt;Sergio López&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;SRE at Red Hat &lt;a href=&#34;github.com/slopezz&#34; target=&#34;_blank&#34;&gt;@slopezz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;</description></item><item><title>yodo</title><link>https://rael.io/project/yodo/</link><pubDate>Mon, 26 Aug 2019 11:23:56 +0200</pubDate><guid>https://rael.io/project/yodo/</guid><description>
&lt;p&gt;&lt;a href=&#34;https://github.com/raelga/yodo/actions&#34; target=&#34;_blank&#34;&gt;&lt;img src=&#34;https://github.com/raelga/yodo/workflows/Build/badge.svg&#34; alt=&#34;Actions Status&#34; /&gt;&lt;/a&gt;
&lt;a href=&#34;https://travis-ci.org/raelga/yodo&#34; target=&#34;_blank&#34;&gt;&lt;img src=&#34;https://travis-ci.org/raelga/yodo.svg?branch=master&#34; alt=&#34;Build Status&#34; /&gt;&lt;/a&gt;
&lt;a href=&#34;https://goreportcard.com/report/github.com/raelga/yodo&#34; target=&#34;_blank&#34;&gt;&lt;img src=&#34;https://goreportcard.com/badge/github.com/raelga/yodo&#34; alt=&#34;Go Report Card&#34; /&gt;&lt;/a&gt;
&lt;a href=&#34;https://coveralls.io/github/raelga/yodo?branch=master&#34; target=&#34;_blank&#34;&gt;&lt;img src=&#34;https://coveralls.io/repos/github/raelga/yodo/badge.svg?branch=master&#34; alt=&#34;Coverage Status&#34; /&gt;&lt;/a&gt;
&lt;a href=&#34;https://github.com/raelga/yodo/blob/master/LICENSE&#34; target=&#34;_blank&#34;&gt;&lt;img src=&#34;https://img.shields.io/github/license/raelga/yodo&#34; alt=&#34;GitHub&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Simple GoLang &lt;strong&gt;TODO&lt;/strong&gt; application&lt;/p&gt;
&lt;p&gt;This application is just a playground to learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;TDD&lt;/strong&gt; with GoLang&lt;/li&gt;
&lt;li&gt;github.com/spf13/&lt;strong&gt;cobra&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;github.com/spf13/&lt;strong&gt;viper&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;gopkg.in/&lt;strong&gt;yaml&lt;/strong&gt;.v2&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GitHub Actions&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ go build
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;$ ./yodo get
default:
Empty list
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;$ ./yodo add Add verbose mode
add task &amp;quot;Add verbose mode&amp;quot; (false) to file$
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;$ ./yodo get
default:
- [0] &amp;quot;Add verbose mode&amp;quot; (false)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;$ ./yodo do 0
Task 0 done.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;$ ./yodo get
default:
- [0] &amp;quot;Add verbose mode&amp;quot; (true)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;$ cat ~/.yodo/default.yaml
id: 0
name: default
tasks:
- id: 0
status: true
description: Add verbose mode
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Gopher art from &lt;a href=&#34;https://github.com/ashleymcnamara/gophers&#34; target=&#34;_blank&#34;&gt;ashleymcnamara/gophers&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>rael.io</title><link>https://rael.io/project/rael.io/</link><pubDate>Thu, 15 Aug 2019 11:23:56 +0200</pubDate><guid>https://rael.io/project/rael.io/</guid><description>&lt;p&gt;&lt;a href=&#34;https://app.netlify.com/sites/rael/deploys&#34; target=&#34;_blank&#34;&gt;&lt;img src=&#34;https://api.netlify.com/api/v1/badges/17660b24-5ace-4e45-9d81-31237fbc07fd/deploy-status&#34; alt=&#34;Netlify Status&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Static site for rael.io using:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://gohugo.io/&#34; target=&#34;_blank&#34;&gt;Hugo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://sourcethemes.com/academic/&#34; target=&#34;_blank&#34;&gt;Academic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://netlify.com&#34; target=&#34;_blank&#34;&gt;Netlify&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Kubernetes</title><link>https://rael.io/project/kubernetes/</link><pubDate>Wed, 01 Aug 2018 11:23:56 +0200</pubDate><guid>https://rael.io/project/kubernetes/</guid><description>
&lt;p&gt;Contributing to the &lt;a href=&#34;https://kubernetes.io&#34; target=&#34;_blank&#34;&gt;Kubernetes&lt;/a&gt; project in different &lt;a href=&#34;https://git.k8s.io/community/&#34; target=&#34;_blank&#34;&gt;special interest groups&lt;/a&gt;, mainly focused on community engagement, documentation and user/contributor experience.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://gubernator.k8s.io/pr/raelga&#34; target=&#34;_blank&#34;&gt;Gubernator PR Dashboard&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;sig-docs&#34;&gt;sig-docs&lt;/h2&gt;
&lt;p&gt;Lead and approver for the Spanish content at kubernetes.io in &lt;strong&gt;sig-docs&lt;/strong&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://git.k8s.io/community/sig-docs&#34; target=&#34;_blank&#34;&gt;Docs Special Interest Group&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/kubernetes/website/issues/13948&#34; target=&#34;_blank&#34;&gt;Tracking Spanish Localisation Progress (M1) #13948&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;sig-contribex&#34;&gt;sig-contribex&lt;/h2&gt;
&lt;p&gt;Contributor in &lt;strong&gt;sig-contribex&lt;/strong&gt; by organizing events like talks, workshops or the New Contributors Summits during KubeCon. Also working on initiatives to improve the Kubernetes community and the contributor experience.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://git.k8s.io/community/sig-contributor-experience&#34; target=&#34;_blank&#34;&gt;Contributor Experience Special Interest Group&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://discuss.kubernetes.io/u/rael/activity&#34; target=&#34;_blank&#34;&gt;Kubernetes Community Forums&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/cncf/presentations/tree/master/kubernetes#kubernetes-introductions&#34; target=&#34;_blank&#34;&gt;Contributing to Kubernetes - SIG-Docs hackathon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://rael.io/talk/190601-kubecap-eu19/&#34; target=&#34;_blank&#34;&gt;KubeCap EU&amp;rsquo;19&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;contributor-summits&#34;&gt;Contributor Summits&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://events.linuxfoundation.org/events/contributor-summit-europe-2019/&#34; target=&#34;_blank&#34;&gt;Kubernetes Contributor Summits Barcelona 2019&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=BQ7y2TFOzF4&#34; target=&#34;_blank&#34;&gt;New Contributors Workshop - Welcome and Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/kubernetes/community/tree/master/events/2019/11-contributor-summit&#34; target=&#34;_blank&#34;&gt;2019 Kubernetes Contributor Summit NA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;sig-usability&#34;&gt;sig-usability&lt;/h2&gt;
&lt;p&gt;Contributor in &lt;strong&gt;sig-usability&lt;/strong&gt; to ensure that the Kubernetes project is maximally usable by users of a variety of different backgrounds and abilities.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://git.k8s.io/community/sig-usability&#34; target=&#34;_blank&#34;&gt;Usability Special Interest Group&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;sig-cli&#34;&gt;sig-cli&lt;/h2&gt;
&lt;p&gt;Contributor in &lt;strong&gt;sig-cli&lt;/strong&gt; adding Spanish support to &lt;code&gt;kubectl&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://git.k8s.io/community/sig-cli&#34; target=&#34;_blank&#34;&gt;CLI Special Interest Group&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/kubernetes/kubernetes/issues/78352&#34; target=&#34;_blank&#34;&gt;Add Spanish i18n strings to kubectl #78352&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Go Playground</title><link>https://rael.io/project/go-playground/</link><pubDate>Mon, 12 Feb 2018 11:23:56 +0200</pubDate><guid>https://rael.io/project/go-playground/</guid><description>
&lt;h2 id=&#34;features&#34;&gt;Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Compiles to Machine Code&lt;/li&gt;
&lt;li&gt;Design for concurrence&lt;/li&gt;
&lt;li&gt;Statically typed&lt;/li&gt;
&lt;li&gt;Garbage collected&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;language&#34;&gt;Language&lt;/h2&gt;
&lt;h3 id=&#34;variables&#34;&gt;Variables&lt;/h3&gt;
&lt;p&gt;&lt;a href=&#34;https://blog.golang.org/gos-declaration-syntax&#34; target=&#34;_blank&#34;&gt;https://blog.golang.org/gos-declaration-syntax&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&#34;definition&#34;&gt;Definition&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;var foo string;
foo = &amp;quot;bar&amp;quot; // OK, new value for foo
foo = 5 // compile error, expected string, found int
newfoo = &amp;quot;bar&amp;quot; // compile error, foo is not defined
bar := &amp;quot;foo&amp;quot; // implicit var
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&#34;basic-types&#34;&gt;Basic Types&lt;/h4&gt;
&lt;p&gt;&lt;a href=&#34;https://golang.org/pkg/go/types/&#34; target=&#34;_blank&#34;&gt;https://golang.org/pkg/go/types/&lt;/a&gt; or &lt;code&gt;go doc types&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt; Invalid: {Invalid, 0, &amp;quot;invalid type&amp;quot;},
Bool: {Bool, IsBoolean, &amp;quot;bool&amp;quot;},
Int: {Int, IsInteger, &amp;quot;int&amp;quot;},
Int8: {Int8, IsInteger, &amp;quot;int8&amp;quot;},
Int16: {Int16, IsInteger, &amp;quot;int16&amp;quot;},
Int32: {Int32, IsInteger, &amp;quot;int32&amp;quot;},
Int64: {Int64, IsInteger, &amp;quot;int64&amp;quot;},
Uint: {Uint, IsInteger | IsUnsigned, &amp;quot;uint&amp;quot;},
Uint8: {Uint8, IsInteger | IsUnsigned, &amp;quot;uint8&amp;quot;},
Uint16: {Uint16, IsInteger | IsUnsigned, &amp;quot;uint16&amp;quot;},
Uint32: {Uint32, IsInteger | IsUnsigned, &amp;quot;uint32&amp;quot;},
Uint64: {Uint64, IsInteger | IsUnsigned, &amp;quot;uint64&amp;quot;},
Uintptr: {Uintptr, IsInteger | IsUnsigned, &amp;quot;uintptr&amp;quot;},
Float32: {Float32, IsFloat, &amp;quot;float32&amp;quot;},
Float64: {Float64, IsFloat, &amp;quot;float64&amp;quot;},
Complex64: {Complex64, IsComplex, &amp;quot;complex64&amp;quot;},
Complex128: {Complex128, IsComplex, &amp;quot;complex128&amp;quot;},
String: {String, IsString, &amp;quot;string&amp;quot;},
UnsafePointer: {UnsafePointer, 0, &amp;quot;Pointer&amp;quot;},
UntypedBool: {UntypedBool, IsBoolean | IsUntyped, &amp;quot;untyped bool&amp;quot;},
UntypedInt: {UntypedInt, IsInteger | IsUntyped, &amp;quot;untyped int&amp;quot;},
UntypedRune: {UntypedRune, IsInteger | IsUntyped, &amp;quot;untyped rune&amp;quot;},
UntypedFloat: {UntypedFloat, IsFloat | IsUntyped, &amp;quot;untyped float&amp;quot;},
UntypedComplex: {UntypedComplex, IsComplex | IsUntyped, &amp;quot;untyped complex&amp;quot;},
UntypedString: {UntypedString, IsString | IsUntyped, &amp;quot;untyped string&amp;quot;},
UntypedNil: {UntypedNil, IsUntyped, &amp;quot;untyped nil&amp;quot;},
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;var x byte = 255 // byte alias for uint8
var y byte = x + 5 // overflow to 4
x++ // overflow to 0
var y byte = 0
y = y - 1 // underflow to 255
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;var foo byte = 2
var foo int32 = 260
sum = foo + bar // compilation error different types
foo = bar // compilation error different types
var conv uint8 = uint8(260) // 4
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;arrays&#34;&gt;Arrays&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;var a [2]int
a[0] = 1
a[1] = &amp;quot;foo&amp;quot; // compile error, wrong type
a[1] = 2 // OK
a[2] = 3 // compile error, out of bounds
index := 2
a[index] = 3 // runtime error, out of bounds
n := 5
var b [n]int // compile error, array size must be constant
var c [2]int // OK
c = a // OK, copy all values
var d [4]int
d = a // compile error, wrong type [2]int vs [4]int
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Go will put the array values contiguous in memory adding padding if needed to align with &lt;sup&gt;4&lt;/sup&gt;&amp;frasl;&lt;sub&gt;8&lt;/sub&gt; bytes.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;var a [2][2][2]int
0x00 a[0][0][0]
0x01 a[0][0][1]
0x02 a[0][1][0]
0x03 a[0][1][1]
0x04 a[1][0][0]
0x05 a[1][0][1]
0x06 a[1][1][0]
0x07 a[1][1][1]
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;slices&#34;&gt;Slices&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;TODO&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;### Structs&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;type Person struct {
Name string
Age string
Gender string
Children []Person // OK, can be empty, is a slice
Mother Person // compile error, invalid recurse type
Father Person // Type Person contains a Person, infinite references
Parents []Person // OK, can be empty, is a slice
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;### Pointer&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;var x int = 42
var y *int // pointer to integrer
y = &amp;amp;x // &amp;amp;x returns the pointer to x (address of x)
z := *y // *y derreferences y, gets 42, the value of x
x = 24 // updates x value
z = *y // *y returns the new value of x, 24
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;maps&#34;&gt;Maps&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;TODO&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;definition-scope&#34;&gt;Definition scope&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;x := 0
if condition {
x := 42
}
y := x // y is 0
if condition {
y = 21
}
z := y // z is 21
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;functions&#34;&gt;Functions&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;func foo(x, y int, z bool) int {
if z {
return x + y
} else {
return &amp;quot;bar&amp;quot; // compile error, wrong return type
}
}
func bar() (string, int) {
return &amp;quot;The answer is&amp;quot;, 42
}
func main() {
var x int = foo(1, 2, true) // OK
var y int = foo(1, 2) // compile error, wrong number of arguments
var z int = foo(1, 2, &amp;quot;bar&amp;quot;) // compile error, last argument not a bool
var v bool = foo(1, 2, true) // compile error, wrong return type
a := 1
b := 2
s := foo(a, b, true) + a // OK, compiler knows that a, b and foo are int
str, num := bar() // OK
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;syntax&#34;&gt;Syntax&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Semicolons are inserted by the compiler&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;func foo(x int) int {
x++
return x
}
foo(1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The compiler will put the &lt;code&gt;;&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;func foo(x int) int {
x++;
return x;
};
foo(1);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;### Loops&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;abc := [3]string{&amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot;}
for i, v := rang abc {
// i is the index or key if abc is a map
// v is the value
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&#34;range&#34;&gt;Range&lt;/h4&gt;
&lt;h2 id=&#34;resources&#34;&gt;Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ardanlabs/gotraining&#34; target=&#34;_blank&#34;&gt;https://github.com/ardanlabs/gotraining&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/dariubs/GoBooks&#34; target=&#34;_blank&#34;&gt;https://github.com/dariubs/GoBooks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://openmymind.net/The-Little-Go-Book/&#34; target=&#34;_blank&#34;&gt;http://openmymind.net/The-Little-Go-Book/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=UvpSDtbdGDM&#34; target=&#34;_blank&#34;&gt;https://www.youtube.com/watch?v=UvpSDtbdGDM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=G3PvTWRIhZA&#34; target=&#34;_blank&#34;&gt;https://www.youtube.com/watch?v=G3PvTWRIhZA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=ytEkHepK08c&#34; target=&#34;_blank&#34;&gt;https://www.youtube.com/watch?v=ytEkHepK08c&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://codegangsta.gitbooks.io/building-web-apps-with-go&#34; target=&#34;_blank&#34;&gt;https://codegangsta.gitbooks.io/building-web-apps-with-go&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://golang.org/doc/code.html#Organization&#34; target=&#34;_blank&#34;&gt;https://golang.org/doc/code.html#Organization&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Gopher art from &lt;a href=&#34;https://github.com/ashleymcnamara/gophers&#34; target=&#34;_blank&#34;&gt;ashleymcnamara/gophers&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>tgfwdbot</title><link>https://rael.io/project/tgfwdbot/</link><pubDate>Sun, 09 Jul 2017 11:23:56 +0200</pubDate><guid>https://rael.io/project/tgfwdbot/</guid><description>
&lt;p&gt;&lt;a href=&#34;https://travis-ci.org/raelga/tgfwdbot&#34; target=&#34;_blank&#34;&gt;&lt;img src=&#34;https://travis-ci.org/raelga/tgfwdbot.svg?branch=master&#34; alt=&#34;Build Status&#34; /&gt;&lt;/a&gt;
&lt;a href=&#34;https://goreportcard.com/report/github.com/raelga/tgfwdbot&#34; target=&#34;_blank&#34;&gt;&lt;img src=&#34;https://goreportcard.com/badge/github.com/raelga/tgfwdbot&#34; alt=&#34;Go Report&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bot to forward messages between supergroups and private chats, to allow talking in Telegram supergroups when banned.&lt;/p&gt;
&lt;h2 id=&#34;why&#34;&gt;Why&lt;/h2&gt;
&lt;p&gt;Sometimes, due to trolls reporters, users can be banned from any Telegram supergroup, not only the one where reported.
With this bot, users will be able to participate in specific groups through the bot.&lt;/p&gt;
&lt;p&gt;This bot can be added to the group, identified by &lt;code&gt;TELEGRAM_GROUP_ID&lt;/code&gt;, and will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Forward any message from the Group to the private conversation with the banned user&lt;/li&gt;
&lt;li&gt;Forward any message from the private conversation with the banned user to the Group&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The admins of the groups where the bot is a member will decide if the allows the banned users to participate or not.&lt;/p&gt;
&lt;h2 id=&#34;disclaimer&#34;&gt;Disclaimer&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;This bot is not intended to be a tool for spammers and malicious users to bypass Telegram bans.&lt;/strong&gt;
The purpose is to allow users to interact in the groups with the authorization of the group admins when globally banned from supergroups due to troll reportings.&lt;/p&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Gopher art from &lt;a href=&#34;https://github.com/ashleymcnamara/gophers&#34; target=&#34;_blank&#34;&gt;ashleymcnamara/gophers&lt;/a&gt;.&lt;/p&gt;</description></item></channel></rss>