Homepage
Open in app
Sign inGet started

golangspec

To understand Go’s specification

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):
Go to the profile of Michał Łowicki
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.
Go to the profile of Michał Łowicki
Michał Łowicki
Mar 10, 2020
Equality in Golang

Equality in Golang

Tale of comparison operators and {DeepEqual,Equal,EqualFold} methods
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
Michał Łowicki
Jan 14, 2020
range clause and the address of iteration variable

range clause and the address of iteration variable

(source code)
Go to the profile of Michał Łowicki
Michał Łowicki
Jul 6, 2018
sync.RWMutex

sync.RWMutex

Solving readers-writers problems
Go to the profile of Michał Łowicki
Michał Łowicki
Mar 26, 2018
Synchronization queues in Golang

Synchronization queues in Golang

how to use channels to write idiomatic code in Go
Go to the profile of Michał Łowicki
Michał Łowicki
Mar 12, 2018
Reusable barriers in Golang

Reusable barriers in Golang

How to implement them using buffered channels
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
Michał Łowicki
Feb 27, 2017
Interfaces in Go (part II)

Interfaces in Go (part II)

Type assertion & type switch
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
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:
Go to the profile of Michał Łowicki
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:
Go to the profile of Michał Łowicki
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…
Go to the profile of Michał Łowicki
Michał Łowicki
Jan 30, 2017
About golangspecLatest StoriesArchiveAbout MediumTermsPrivacyTeams