diff --git a/gotime/.gitignore b/gotime/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/gotime/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/gotime/Makefile b/gotime/Makefile new file mode 100644 index 0000000..a803d1d --- /dev/null +++ b/gotime/Makefile @@ -0,0 +1,12 @@ +SOURCES := $(shell find src -name '*.go') +TARGETS := $(patsubst src/%.go,bin/%,$(SOURCES)) + +bin/%: src/%.go + go build -o $@ $^ + +all: $(TARGETS) + +clean: + rm -v bin/* + +.PHONY: all clean diff --git a/gotime/bin/.gitkeep b/gotime/bin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/gotime/src/maps.go b/gotime/src/maps.go new file mode 100644 index 0000000..991285d --- /dev/null +++ b/gotime/src/maps.go @@ -0,0 +1,18 @@ +// From go-tour #28 +package main + +import "fmt" + +type Vertex struct { + Lat, Long float64 +} + +var m map[string]Vertex + +func main() { + m = make(map[string]Vertex) + m["Bell Labs"] = Vertex{ + 40.68433, 74.39967, + } + fmt.Println(m["Bell Labs"]) +}