Skip to content

Instantly share code, notes, and snippets.


After getting used to GOPATH

When first encountering Golang, usage of GOPATH was really hard: why should everything be in the same directory structure? What about versioning? How can I stop making it break?

Using was a very good band-aid that worked very well for 3 years. Over time we got used to the GOPATH, even when it disappeared into go env GOPATH. We got so used to it, that we started using it in bash scripts, like this:

View tlskc.go
package network
import (

Keybase proof

I hereby claim:

  • I am ineiti on github.
  • I am ineiti ( on keybase.
  • I have a public key whose fingerprint is 529D 5B27 276D 66AC A362 DE8D D836 2CB7 4719 337E

To claim this, I am signing this object:

View test.go
// All known channels
var channels map[reflect.Type]interface{}
// RegisterChannel stores a channel and the message-type
func RegisterChannel(c interface{}) error {
if channels == nil {
channels = make(map[reflect.Type]interface{})
cr := reflect.TypeOf(c)
You can’t perform that action at this time.