diff --git a/.gitignore b/.gitignore index f143033..316860d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ client/src/css/stylesheet.css* # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 .glide/ -# Project-local glide vendor files +# Project-local vendor files /vendor/ # Project-local test and coverage files diff --git a/.travis.yml b/.travis.yml index 2ac45f7..616742d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,12 @@ branches: os: - linux +go: + - "1.12" + +env: + - GO111MODULE=on + before_install: - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - - sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg @@ -17,12 +23,6 @@ cache: directories: - "$HOME/.yarn-cache" -install: - - go get -v github.com/Masterminds/glide - - cd $GOPATH/src/github.com/Masterminds/glide && git checkout tags/v0.12.3 && go install - && cd - - - glide install - before_script: - nvm install 6 - npm install -g typescript diff --git a/Makefile b/Makefile index 232868f..0eb9662 100644 --- a/Makefile +++ b/Makefile @@ -6,23 +6,25 @@ GOPATH := ${PWD}/.gopath~ GOBIN := $(GOPATH)/bin BASE := $(GOPATH)/src/$(PACKAGE) +# Force Go modules to be enabled +export GO111MODULE=on + # use user-given PKG variable # otherwise do `go list ./...`, but ignore files in vendor/ directory # TODO: check if this is portable enough, otherwise we might need to rewrite this logic -PKGS = $(or $(PKG),$(shell cd $(BASE) && env GOPATH=$(GOPATH) $(GO) list ./... | grep -v "^$(PACKAGE)/vendor/")) -TESTPKGS = $(shell env GOPATH=$(GOPATH) $(GO) list -f '{{ if .TestGoFiles }}{{ .ImportPath }}{{ end }}' $(PKGS)) +PKGS = $(or $(PKG),$(shell $(GO) list -m -f "{{ .Path }}" all | grep $(PACKAGE))) +TESTPKGS = $(shell $(GO) list -f '{{ if .TestGoFiles }}{{ .ImportPath }}{{ end }}' $(PKGS)) GO = go GODOC = godoc GOFMT = gofmt -GLIDE = glide TIMEOUT = 15 V := 0 Q := $(if $(filter 1,$V),,@) .PHONY: all all: fmt lint vendor | $(BASE) ; $(info building executable...) @ ## Build program binary - $Q cd $(BASE) && $(GO) build \ + $Q $(GO) build \ -tags release \ -ldflags '-X $(PACKAGE)/cmd.Version=$(VERSION) -X $(PACKAGE)/cmd.BuildDate=$(DATE)' \ -o bin/$(PACKAGE) main.go @@ -45,7 +47,8 @@ $(GOBIN)/gocovmerge: | $(BASE) ; $(info building gocovmerge...) $Q go get github.com/wadey/gocovmerge GOCOV = $(GOBIN)/gocov -$(GOBIN)/gocov: | $(BASE) ; $(info building gocov...) +$(GOBIN)/gocov: | $(BASE) ; $(info building gocov...) @ ## Hack: https://github.com/golang/go/issues/27215#issuecomment-451342769 + $Q go get github.com/axw/gocov $Q go get github.com/axw/gocov/... GOCOVXML = $(GOBIN)/gocov-xml @@ -94,10 +97,10 @@ test-coverage-tools: | $(GOCOVMERGE) $(GOCOV) $(GOCOVXML) test-coverage: COVERAGE_DIR := $(CURDIR)/test/coverage.$(shell date +%F_%H-%M-%S) test-coverage: fmt lint vendor test-coverage-tools | $(BASE) ; $(info running coverage tests...) @ ## Run coverage tests $Q mkdir -p $(COVERAGE_DIR)/coverage - $Q cd $(BASE) && for pkg in $(TESTPKGS); do \ + $Q for pkg in $(TESTPKGS); do \ $(GO) test \ -coverpkg=$$($(GO) list -f '{{ join .Deps "\n" }}' $$pkg | \ - grep '^$(PACKAGE)/' | grep -v '^$(PACKAGE)/vendor/' | \ + grep '$(PACKAGE)/' | grep -v '$(PACKAGE)/vendor/' | \ tr '\n' ',')$$pkg \ -covermode=$(COVERAGE_MODE) \ -coverprofile="$(COVERAGE_DIR)/coverage/`echo $$pkg | tr "/" "-"`.cover" $$pkg || exit 1; \ @@ -108,7 +111,7 @@ test-coverage: fmt lint vendor test-coverage-tools | $(BASE) ; $(info running co .PHONY: lint lint: vendor | $(BASE) $(GOLINT) ; $(info running golint...) @ ## Run golint - $Q cd $(BASE) && ret=0 && for pkg in $(PKGS); do \ + $Q ret=0 && for pkg in $(PKGS); do \ test -z "$$($(GOLINT) $$pkg | tee /dev/stderr)" || ret=1 ; \ done ; exit $$ret @@ -118,17 +121,11 @@ fmt: ; $(info running gofmt...) @ ## Run gofmt on all source files $(GOFMT) -l -w $$d/*.go || ret=$$? ; \ done ; exit $$ret - ######################### # Dependency management # ######################### -glide.lock: glide.yaml | $(BASE) ; $(info updating dependencies...) - $Q cd $(BASE) && $(GLIDE) update - @touch $@ -vendor: glide.lock | $(BASE) ; $(info retrieving dependencies...) - $Q cd $(BASE) && $(GLIDE) --quiet install - @ln -sf . vendor/src - @touch $@ +vendor: | $(BASE) ; $(info retrieving dependencies...) + $(GO) mod vendor ################# @@ -139,6 +136,7 @@ clean: ; $(info cleaning...) @ ## Cleanup everything @rm -rf $(GOPATH) @rm -rf bin @rm -rf test/tests.* test/coverage.* + @rm -rf vendor .PHONY: help help: diff --git a/README.md b/README.md index 7dd8025..5b69a6a 100644 --- a/README.md +++ b/README.md @@ -65,22 +65,12 @@ export GOPATH=$HOME/shared/go If you haven't changed the shell, you will also need to edit the GOPATH in your Bash profile. In `~/.bashrc`, locate the line near the bottom of the file that starts with `export GOPATH=`, and modify the line to say `export GOPATH=/home/vagrant/shared/go`. -We use [Glide](https://github.com/Masterminds/glide) to manage vendored -dependencies. - -When installing Glide, it may complain that you do not have a `bin` folder in your $GOPATH. Rectify this by creating a bin folder, setting $GOBIN, then adding it to your path. - -```bash -cd $GOPATH && mkdir bin -export GOBIN=$GOPATH/bin -export PATH=$PATH:$GOBIN -``` - -Once you've installed Glide, get and compile the code. +Once you've set up the GOPATH variable, get and compile the code. Please note that since we're using [go modules](https://github.com/golang/go/wiki/Modules) for dependency management, the telemetry repository should not be located under GOPATH. ```bash -go get -d github.com/uw-midsun/telemetry -cd $GOPATH/src/github.com/uw-midsun/telemetry +cd ~/shared +git clone https://github.com/uw-midsun/telemetry.git +cd telemetry make ``` diff --git a/glide.lock b/glide.lock deleted file mode 100644 index 6e09169..0000000 --- a/glide.lock +++ /dev/null @@ -1,38 +0,0 @@ -hash: 4457c8b8aacb0806d7274cf568f2646951a0b2c36f8b236c203aa82221b9138c -updated: 2018-06-23T13:06:32.412376934-04:00 -imports: -- name: github.com/golang/glog - version: 23def4e6c14b4da8ac2ed8007337bc5eb5007998 -- name: github.com/golang/protobuf - version: 5831880292e721c76b58a16ecc60adc27d8e6355 - subpackages: - - proto -- name: github.com/gorilla/websocket - version: 3f3e394da2b801fbe732a935ef40724762a67a07 -- name: github.com/inconshreveable/mousetrap - version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 -- name: github.com/jacobsa/go-serial - version: 15cf729a72d49e837fa047a4142fa6e4d5ab45a1 - subpackages: - - serial -- name: github.com/mattn/go-sqlite3 - version: eac1dfa2a61ebccaa117538a5bb12044f6700cd0 -- name: github.com/mrVanboy/go-simple-cobs - version: bc19984395e89df8be1728f2b032fa087412b570 -- name: github.com/pkg/errors - version: 248dadf4e9068a0b3e79f02ed0a610d935de5302 -- name: github.com/pressly/chi - version: 5917107c1cecb42eb3dbca2246b160285562799b -- name: github.com/spf13/cobra - version: ee4055870c2d5f7ce112642377e32c9929c3bbaf -- name: github.com/spf13/pflag - version: 103ce5cd2042f2fe629c1957abb64ab3e7f50235 -- name: golang.org/x/net - version: a6577fac2d73be281a500b310739095313165611 - subpackages: - - context -- name: golang.org/x/sys - version: c11f84a56e43e20a78cee75a7c034031ecf57d1f - subpackages: - - unix -testImports: [] diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index 6d8f7b4..0000000 --- a/glide.yaml +++ /dev/null @@ -1,12 +0,0 @@ -package: telemetry -ignore: -- telemetry -import: -- package: github.com/golang/glog -- package: github.com/golang/protobuf -- package: github.com/gorilla/websocket -- package: github.com/pkg/errors -- package: github.com/pressly/chi -- package: github.com/spf13/cobra -- package: github.com/mattn/go-sqlite3 -- package: github.com/mrVanboy/go-simple-cobs diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ad2ecee --- /dev/null +++ b/go.mod @@ -0,0 +1,52 @@ +module github.com/uw-midsun/telemetry + +go 1.12 + +require ( + github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737 // indirect + github.com/axw/gocov v0.0.0-20170322000131-3a69a0d2a4ef // indirect + github.com/go-chi/chi v0.0.0-20170216185340-5917107c1cec // indirect + github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect + github.com/golang/protobuf v0.0.0-20180612185929-5831880292e7 // indirect + github.com/gorilla/websocket v0.0.0-20170218162710-3f3e394da2b8 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jacobsa/go-serial v0.0.0-20180131005756-15cf729a72d4 // indirect + github.com/mattn/go-sqlite3 v0.0.0-20170305140206-eac1dfa2a61e // indirect + github.com/mrVanboy/go-simple-cobs v0.0.0-20180102074149-bc19984395e8 // indirect + github.com/pkg/errors v0.0.0-20161029093637-248dadf4e906 // indirect + github.com/spf13/cobra v0.0.0-20170217164507-ee4055870c2d // indirect + github.com/spf13/pflag v0.0.0-20160820154156-103ce5cd2042 // indirect + github.com/uw-midsun/telemetry/pkg/canmsgdefs v0.0.0 // indirect + github.com/uw-midsun/telemetry/pkg/cli v0.0.0 + github.com/uw-midsun/telemetry/pkg/db v0.0.0 // indirect + github.com/uw-midsun/telemetry/pkg/msgs v0.0.0 // indirect + github.com/uw-midsun/telemetry/pkg/protos v0.0.0-00010101000000-000000000000 // indirect + github.com/uw-midsun/telemetry/pkg/pubsub v0.0.0-00010101000000-000000000000 // indirect + github.com/uw-midsun/telemetry/pkg/sources/fake v0.0.0-00010101000000-000000000000 // indirect + github.com/uw-midsun/telemetry/pkg/sources/serial v0.0.0-00010101000000-000000000000 // indirect + github.com/uw-midsun/telemetry/pkg/util/randutil v0.0.0-00010101000000-000000000000 // indirect + github.com/uw-midsun/telemetry/pkg/ws v0.0.0-00010101000000-000000000000 // indirect + github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad // indirect + golang.org/x/lint v0.0.0-20190409202823-959b441ac422 // indirect + golang.org/x/sync v0.0.0-20190412183630-56d357773e84 // indirect +) + +replace github.com/uw-midsun/telemetry/pkg/cli => ./pkg/cli + +replace github.com/uw-midsun/telemetry/pkg/db => ./pkg/db + +replace github.com/uw-midsun/telemetry/pkg/msgs => ./pkg/msgs + +replace github.com/uw-midsun/telemetry/pkg/canmsgdefs => ./pkg/canmsgdefs + +replace github.com/uw-midsun/telemetry/pkg/protos => ./pkg/protos + +replace github.com/uw-midsun/telemetry/pkg/pubsub => ./pkg/pubsub + +replace github.com/uw-midsun/telemetry/pkg/sources/fake => ./pkg/sources/fake + +replace github.com/uw-midsun/telemetry/pkg/sources/serial => ./pkg/sources/serial + +replace github.com/uw-midsun/telemetry/pkg/util/randutil => ./pkg/util/randutil + +replace github.com/uw-midsun/telemetry/pkg/ws => ./pkg/ws diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..442739d --- /dev/null +++ b/go.sum @@ -0,0 +1,44 @@ +github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737 h1:JZHBkt0GhM+ARQykshqpI49yaWCHQbJonH3XpDTwMZQ= +github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737/go.mod h1:w1KSuh2JgIL3nyRiZijboSUwbbxOrTzWwyWVFUHtXBQ= +github.com/axw/gocov v0.0.0-20170322000131-3a69a0d2a4ef h1:kh7Fi8sfEY7aCl42VEEvGv7lez2YCOmO120N1fASWGc= +github.com/axw/gocov v0.0.0-20170322000131-3a69a0d2a4ef/go.mod h1:pc6XrbIn8RLeVSNzXCZKXNst+RTE5Ju/nySYl1Wc0B4= +github.com/go-chi/chi v0.0.0-20170216185340-5917107c1cec h1:vtn7pnCfgrvNi3h1CcUgwtJ0DN1PCGGudfGDotR2Iks= +github.com/go-chi/chi v0.0.0-20170216185340-5917107c1cec/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/protobuf v0.0.0-20180612185929-5831880292e7 h1:swaFJZm8TbtHskgBqkrUK1Q5W6l0yKZSh5jlHaA9ldQ= +github.com/golang/protobuf v0.0.0-20180612185929-5831880292e7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/gorilla/websocket v0.0.0-20170218162710-3f3e394da2b8 h1:UrjxDZdgSDgal3gEEH1Ug7EHBIuYln8lSN7rwNkkLlI= +github.com/gorilla/websocket v0.0.0-20170218162710-3f3e394da2b8/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jacobsa/go-serial v0.0.0-20180131005756-15cf729a72d4 h1:G2ztCwXov8mRvP0ZfjE6nAlaCX2XbykaeHdbT6KwDz0= +github.com/jacobsa/go-serial v0.0.0-20180131005756-15cf729a72d4/go.mod h1:2RvX5ZjVtsznNZPEt4xwJXNJrM3VTZoQf7V6gk0ysvs= +github.com/mattn/go-sqlite3 v0.0.0-20170305140206-eac1dfa2a61e h1:AI4kVwkgPj55D76TxcJHTNl3y7TiOZ0IDpEiwunOexI= +github.com/mattn/go-sqlite3 v0.0.0-20170305140206-eac1dfa2a61e/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mrVanboy/go-simple-cobs v0.0.0-20180102074149-bc19984395e8 h1:6e7FpwhHlRWVOOHiFTpajP0EHNYFLDw54ZMlx2mmdGk= +github.com/mrVanboy/go-simple-cobs v0.0.0-20180102074149-bc19984395e8/go.mod h1:EPw4BDT6S3WhWibsK568dLX1jNY76uo/JGIAeef4sBM= +github.com/pkg/errors v0.0.0-20161029093637-248dadf4e906 h1:aXc/AM323HlkOXjl3QuSO06wbXK45HrzBT+pwVOufXg= +github.com/pkg/errors v0.0.0-20161029093637-248dadf4e906/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/spf13/cobra v0.0.0-20170217164507-ee4055870c2d h1:ypp9F1Q6OvwCUqqlgX/6E8FOzcJLwVJR5P0bVW9V8AU= +github.com/spf13/cobra v0.0.0-20170217164507-ee4055870c2d/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v0.0.0-20160820154156-103ce5cd2042 h1:VWlVV19lRdqmaPmY4E9ZPm1jN+7q6AUdRaKZG5HO5zw= +github.com/spf13/pflag v0.0.0-20160820154156-103ce5cd2042/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0= +github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422 h1:QzoH/1pFpZguR8NrRHLcO6jKqfv2zpuSqZLgdm7ZmjI= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20170308210134-a6577fac2d73 h1:5kGFsglTK4KqaHYb/WCmYmj+Gm1+dzbilbtzruHj6dw= +golang.org/x/net v0.0.0-20170308210134-a6577fac2d73/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84 h1:IqXQ59gzdXv58Jmm2xn0tSOR9i6HqroaOFRQ3wR/dJQ= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180525142821-c11f84a56e43 h1:PvnWIWTbA7gsEBkKjt0HV9hckYfcqYv8s/ju7ArZ0do= +golang.org/x/sys v0.0.0-20180525142821-c11f84a56e43/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= diff --git a/main.go b/main.go index b391141..1864a6d 100644 --- a/main.go +++ b/main.go @@ -2,7 +2,7 @@ package main import ( "flag" - "telemetry/pkg/cli" + "github.com/uw-midsun/telemetry/pkg/cli" ) func main() { diff --git a/pkg/canmsgdefs/go.mod b/pkg/canmsgdefs/go.mod new file mode 100644 index 0000000..67cd024 --- /dev/null +++ b/pkg/canmsgdefs/go.mod @@ -0,0 +1,3 @@ +module canmsgdefs + +go 1.12 diff --git a/pkg/cli/go.mod b/pkg/cli/go.mod new file mode 100644 index 0000000..b93fdba --- /dev/null +++ b/pkg/cli/go.mod @@ -0,0 +1,3 @@ +module cli + +go 1.12 diff --git a/pkg/cli/start.go b/pkg/cli/start.go index 3215bf5..5cb9e39 100644 --- a/pkg/cli/start.go +++ b/pkg/cli/start.go @@ -7,14 +7,14 @@ import ( "os/exec" "path/filepath" + "github.com/go-chi/chi" log "github.com/golang/glog" - "github.com/pressly/chi" "github.com/spf13/cobra" - "telemetry/pkg/db" - "telemetry/pkg/msgs" - "telemetry/pkg/pubsub" - "telemetry/pkg/ws" + "github.com/uw-midsun/telemetry/pkg/db" + "github.com/uw-midsun/telemetry/pkg/msgs" + "github.com/uw-midsun/telemetry/pkg/pubsub" + "github.com/uw-midsun/telemetry/pkg/ws" ) var startCmd = &cobra.Command{ diff --git a/pkg/db/can_db.go b/pkg/db/can_db.go index 01d2eeb..8c5c293 100644 --- a/pkg/db/can_db.go +++ b/pkg/db/can_db.go @@ -9,8 +9,8 @@ import ( log "github.com/golang/glog" _ "github.com/mattn/go-sqlite3" // DB impl - "telemetry/pkg/msgs" - "telemetry/pkg/pubsub" + "github.com/uw-midsun/telemetry/pkg/msgs" + "github.com/uw-midsun/telemetry/pkg/pubsub" ) // RunDb creates a table and sinks all "CAN" pubsub messages into it via the WriteMsg method. diff --git a/pkg/db/can_db_linux_arm.go b/pkg/db/can_db_linux_arm.go index 94b6887..cc1b0a6 100644 --- a/pkg/db/can_db_linux_arm.go +++ b/pkg/db/can_db_linux_arm.go @@ -11,8 +11,8 @@ import ( log "github.com/golang/glog" - "telemetry/pkg/msgs" - "telemetry/pkg/pubsub" + "github.com/uw-midsun/telemetry/pkg/msgs" + "github.com/uw-midsun/telemetry/pkg/pubsub" ) // RunDb on ARM uses a logfile since there is no sqlite driver for armeabi-v7a. diff --git a/pkg/db/go.mod b/pkg/db/go.mod new file mode 100644 index 0000000..2b2de69 --- /dev/null +++ b/pkg/db/go.mod @@ -0,0 +1,3 @@ +module candb + +go 1.12 diff --git a/pkg/db/sql_api.go b/pkg/db/sql_api.go index 395b811..2d92c8f 100644 --- a/pkg/db/sql_api.go +++ b/pkg/db/sql_api.go @@ -6,7 +6,7 @@ import ( "encoding/json" "time" - "telemetry/pkg/msgs" + "github.com/uw-midsun/telemetry/pkg/msgs" ) // WriteMsg commits a CAN message to the database. diff --git a/pkg/db/sql_api_test.go b/pkg/db/sql_api_test.go index acb63e7..ec0bb68 100644 --- a/pkg/db/sql_api_test.go +++ b/pkg/db/sql_api_test.go @@ -3,7 +3,7 @@ package candb import ( "database/sql" _ "github.com/mattn/go-sqlite3" - "telemetry/pkg/msgs" + "github.com/uw-midsun/telemetry/pkg/msgs" "testing" "time" ) diff --git a/pkg/msgs/can_msgs.go b/pkg/msgs/can_msgs.go index 967d1f0..be08297 100644 --- a/pkg/msgs/can_msgs.go +++ b/pkg/msgs/can_msgs.go @@ -10,7 +10,7 @@ import ( log "github.com/golang/glog" "github.com/golang/protobuf/proto" - canpb "telemetry/pkg/protos" + canpb "github.com/uw-midsun/telemetry/pkg/protos" ) // CAN describes a single message from the CAN bus. This assumes network layer CAN! ID is the diff --git a/pkg/msgs/go.mod b/pkg/msgs/go.mod new file mode 100644 index 0000000..8b9b051 --- /dev/null +++ b/pkg/msgs/go.mod @@ -0,0 +1,3 @@ +module msgs + +go 1.12 diff --git a/pkg/protos/go.mod b/pkg/protos/go.mod new file mode 100644 index 0000000..38ff18f --- /dev/null +++ b/pkg/protos/go.mod @@ -0,0 +1,3 @@ +module protos + +go 1.12 diff --git a/pkg/pubsub/go.mod b/pkg/pubsub/go.mod new file mode 100644 index 0000000..488f6f0 --- /dev/null +++ b/pkg/pubsub/go.mod @@ -0,0 +1,3 @@ +module pubsub + +go 1.12 diff --git a/pkg/sources/fake/fake.go b/pkg/sources/fake/fake.go index 6043ada..f52bea1 100644 --- a/pkg/sources/fake/fake.go +++ b/pkg/sources/fake/fake.go @@ -4,10 +4,10 @@ import ( "math" "time" - "telemetry/pkg/canmsgdefs" - "telemetry/pkg/msgs" - "telemetry/pkg/pubsub" - "telemetry/pkg/util/randutil" + "github.com/uw-midsun/telemetry/pkg/canmsgdefs" + "github.com/uw-midsun/telemetry/pkg/msgs" + "github.com/uw-midsun/telemetry/pkg/pubsub" + "github.com/uw-midsun/telemetry/pkg/util/randutil" ) const ( diff --git a/pkg/sources/fake/go.mod b/pkg/sources/fake/go.mod new file mode 100644 index 0000000..6dc3b2f --- /dev/null +++ b/pkg/sources/fake/go.mod @@ -0,0 +1,3 @@ +module fake + +go 1.12 diff --git a/pkg/sources/serial/go.mod b/pkg/sources/serial/go.mod new file mode 100644 index 0000000..7535c19 --- /dev/null +++ b/pkg/sources/serial/go.mod @@ -0,0 +1,3 @@ +module serial + +go 1.12 diff --git a/pkg/sources/serial/serial.go b/pkg/sources/serial/serial.go index 3e86f2e..9f0da6d 100644 --- a/pkg/sources/serial/serial.go +++ b/pkg/sources/serial/serial.go @@ -11,8 +11,8 @@ import ( "github.com/jacobsa/go-serial/serial" "github.com/mrVanboy/go-simple-cobs" - "telemetry/pkg/msgs" - "telemetry/pkg/pubsub" + "github.com/uw-midsun/telemetry/pkg/msgs" + "github.com/uw-midsun/telemetry/pkg/pubsub" ) const canRxHeader = 0x585243 diff --git a/pkg/util/randutil/go.mod b/pkg/util/randutil/go.mod new file mode 100644 index 0000000..4f680ea --- /dev/null +++ b/pkg/util/randutil/go.mod @@ -0,0 +1,3 @@ +module randutil + +go 1.12 diff --git a/pkg/ws/go.mod b/pkg/ws/go.mod new file mode 100644 index 0000000..b5b3172 --- /dev/null +++ b/pkg/ws/go.mod @@ -0,0 +1,3 @@ +module ws + +go 1.12 diff --git a/pkg/ws/ws.go b/pkg/ws/ws.go index 0c0d26e..f7ade7c 100644 --- a/pkg/ws/ws.go +++ b/pkg/ws/ws.go @@ -4,10 +4,10 @@ import ( "net/http" "time" - "telemetry/pkg/msgs" - "telemetry/pkg/pubsub" - "telemetry/pkg/sources/fake" - "telemetry/pkg/sources/serial" + "github.com/uw-midsun/telemetry/pkg/msgs" + "github.com/uw-midsun/telemetry/pkg/pubsub" + "github.com/uw-midsun/telemetry/pkg/sources/fake" + "github.com/uw-midsun/telemetry/pkg/sources/serial" "sync"