Homepage
Open in app
Sign in
Get started
golangspec
To understand Go’s specification
Follow
Untyped constants in Go
Untyped constants in Go
Let’s start with quiz comparing two programs which differ only by single statement. Program C uses constant declaration (source code):
Michał Łowicki
Mar 19, 2020
Pointer receiver methods and iteration variables
Pointer receiver methods and iteration variables
One more gotcha with re-using range clause variables.
Michał Łowicki
Mar 10, 2020
Equality in Golang
Equality in Golang
Tale of comparison operators and {DeepEqual,Equal,EqualFold} methods
Michał Łowicki
Feb 26, 2020
Defer statement in Golang (part I)
Defer statement in Golang (part I)
Deferred function is declared inside another function and is called when surrounding function exits — either normally or if goroutine…
Michał Łowicki
Feb 2, 2020
“for” statement and its all faces in Golang
“for” statement and its all faces in Golang
In contrast to many other languages, Go doesn’t have multiple constructs for executing block of code repeatedly. There’s single statement…
Michał Łowicki
Jan 14, 2020
range clause and the address of iteration variable
range clause and the address of iteration variable
(source code)
Michał Łowicki
Jul 6, 2018
sync.RWMutex
sync.RWMutex
Solving readers-writers problems
Michał Łowicki
Mar 26, 2018
Synchronization queues in Golang
Synchronization queues in Golang
how to use channels to write idiomatic code in Go
Michał Łowicki
Mar 12, 2018
Reusable barriers in Golang
Reusable barriers in Golang
How to implement them using buffered channels
Michał Łowicki
Feb 27, 2018
Tags in Golang
Tags in Golang
Declaration of struct fields can be enriched by string literal placed afterwards — tag. Tags add meta information used either by current…
Michał Łowicki
Feb 19, 2018
Import declarations in Go
Import declarations in Go
Programs in Go are made up of packages. Usually package depends on other packages either those built-in into the standard library or 3rd…
Michał Łowicki
Jan 15, 2018
Introduction to bufio package in Golang
Introduction to bufio package in Golang
Package bufio helps with buffered I/O. Through a bunch of examples we’ll get familiar with goodies it provides: Reader, Writer and Scanner…
Michał Łowicki
Nov 23, 2017
In-depth introduction to bufio.Scanner in Golang
In-depth introduction to bufio.Scanner in Golang
Go is shipped with package helping with buffered I/O — technique to optimize read or write operations. For writes it’s done by temporary…
Michał Łowicki
Nov 9, 2017
Globally unique key for context value in Golang
Globally unique key for context value in Golang
Suppose you’ve a context which is passed across many packages. Any of these packages can put there information (f.ex. something related to…
Michał Łowicki
Sep 17, 2017
Making debugger in Golang (part III)
Making debugger in Golang (part III)
So far we’ve learned how to single-step ptraced process (tracee) and get some debugging info out of binary (read it here if you haven’t…
Michał Łowicki
Jul 31, 2017
Making debugger in Golang (part II)
Making debugger in Golang (part II)
During the first part we’ve bootstrapped development environment and made a simple program (tracer) which stops child process (tracee) at…
Michał Łowicki
Jul 3, 2017
Making debugger for Golang (part I)
Making debugger for Golang (part I)
The goal of this series is not to write full-featured debugger for Go programming language. If you’re looking for some then please take a…
Michał Łowicki
May 8, 2017
Multi-valued expressions in Go
Multi-valued expressions in Go
Expression describes computation of value and consists of operands (identifiers, literal, another expression between parentheses, …) which…
Michał Łowicki
Apr 10, 2017
Elide type in composite literals in Golang
Elide type in composite literals in Golang
Composite types are containers for other values. In Golang composite types are arrays, slices, maps and structs. Composite literals specify…
Michał Łowicki
Mar 6, 2017
Interfaces in Go (part III)
Interfaces in Go (part III)
This story introduces another set of interfaces-related topics in Golang. It explains things like method expression derived from interface…
Michał Łowicki
Feb 27, 2017
Interfaces in Go (part II)
Interfaces in Go (part II)
Type assertion & type switch
Michał Łowicki
Feb 20, 2017
Interfaces in Go (part I)
Interfaces in Go (part I)
Interfaces make the code more flexible, scalable and it’s a way to achieve polymorphism in Golang. Instead of requiring a particular type…
Michał Łowicki
Feb 13, 2017
Go code is UTF-8 encoded
Go code is UTF-8 encoded
Unicode plays quite nicely with Golang. Programmer doesn’t have to mark unicode strings in any special way:
Michał Łowicki
Feb 6, 2017
Let’s say you have foo/foo.go:
Let’s say you have foo/foo.go:
and bar/bar.go:
Michał Łowicki
Feb 1, 2017
Selectors in Go
Selectors in Go
Expression foo.bar can mean two things in Go. If foo is a package name then expression is a so-called qualified identifier referencing…
Michał Łowicki
Jan 30, 2017
About golangspec
Latest Stories
Archive
About Medium
Terms
Privacy
Teams