Namespacing work by implementation language

which just might be a horrible idea, but it was feeling cluttered at
just two languages and I'm about to add a third...
This commit is contained in:
Dan Buch
2012-11-14 17:56:40 -05:00
parent 7155d76a11
commit 1120412e45
10 changed files with 2 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
export GOPATH="$GOROOT:$HOME/src/box-o-sand/src/sylvilagus"
test -n "$GOROOT" && source "$GOROOT/misc/bash/go"

3
sylvilagus/go/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
/bin/*
/.env
/src/github.com/

28
sylvilagus/go/Makefile Normal file
View File

@@ -0,0 +1,28 @@
CLEAN_GOPATH := $(shell echo $(GOPATH) | tr ":" "\n" | grep -v '^$$' | grep -v $(PWD) | tr "\n" ":")
GOPATH := $(PWD):$(CLEAN_GOPATH)
PACKAGES := meatballhat.com/sylvilagus-conntest
export GOPATH
test: build
go test $(PACKAGES)
build: deps
go install $(PACKAGES)
deps:
go get $(PACKAGES)
fmt:
go fmt $(PACKAGES)
clean:
rm -v bin/*
find pkg -name '*.a' -exec rm -v {} \;
env:
@echo GOPATH=$(GOPATH)
@echo PACKAGES=$(PACKAGES)
.PHONY: all clean env fmt

View File

@@ -0,0 +1,41 @@
package main
import (
"flag"
"fmt"
"log"
)
import (
"github.com/streadway/amqp"
)
var (
connUri = flag.String("connuri", "amqp://guest:guest@localhost:5672/sylvilagus", "Connection URI for AMQP thingy")
)
func main() {
flag.Parse()
fmt.Printf("Connecting to %v...\n", *connUri)
conn, err := amqp.Dial(*connUri)
defer conn.Close()
if err != nil {
log.Fatal("err:", err)
}
if conn != nil {
log.Println("conn:", conn)
}
channel, err := conn.Channel()
if err != nil {
log.Fatal("err:", err)
}
if channel != nil {
log.Println("channel:", channel)
}
}