In this Go Experience Report I am going to make a case for sum types over multiple return parameters.
I wrote a little tool which does some analysis of Go source code:
_build |
.. table:: Table Name | |
:widths: 1000 1000 | |
+------------------+---------------------------------------------------+ | |
| ❌ | ✅ | | |
+==================+===================================================+ | |
| .. code:: erlang | .. code:: erlang | | |
| | | | |
| File_name | FileName | | |
| File_Name | _File | |
package main | |
import ( | |
"encoding/base64" | |
gojson "encoding/json" | |
"fmt" | |
"io" | |
"github.com/katydid/katydid/parser" | |
"github.com/katydid/katydid/parser/json" |
mybinary |
.stack-work |
GODOCKER = docker run --network host --rm --user $(shell id -u):$(shell id -g) -v $(PWD):/go/src/path/to/project -w /go/src/path/to/project golang:1.8.3-alpine3.6 | |
GOFLAGS = -ldflags '-d' -tags netgo -installsuffix netgo | |
build: | |
$(GODOCKER) go build $(GOFLAGS) -o ./cmd/mycmd/mycmd ./cmd/mycmd | |
test: | |
$(GODOCKER) go test -test.v ./... |
FROM cassandra:3.1.1 | |
RUN mkdir -p /tmp/var/lib/cassandra /etc/cassandra \ | |
&& chown -R cassandra:cassandra /tmp/var/lib/cassandra /etc/cassandra \ | |
&& chmod 777 /tmp/var/lib/cassandra /etc/cassandra | |
RUN sed -i "s~/var/lib/cassandra~/tmp/var/lib/cassandra~g" /etc/cassandra/cassandra.yaml | |
COPY *.cql /tmp/ |
In this Go Experience Report I am going to make a case for sum types over multiple return parameters.
I wrote a little tool which does some analysis of Go source code:
While developing GoDerive, a code generator for Go, I ran into the following problem.
I could not infer the type of the input arguments of a function, if that function's input argument types are not specified and the function is not being called right away.
I wanted to write:
func TestCurriedEqualCompileError(t *testing.T) {
DOCKER_COMPOSE := $(shell command -v docker-compose 2>/dev/null) | |
ifndef DOCKER_COMPOSE | |
DOCKER_COMPOSE = docker run --rm -i --volume /var/run/docker.sock:/var/run/docker.sock --volume $(shell pwd):/composefile -w /composefile docker/compose:1.8.1 | |
endif |