From 5ad687e29e5e75b9bc83ce76397b7f993b544cb9 Mon Sep 17 00:00:00 2001 From: Aidan Shribman Date: Thu, 29 Aug 2019 10:47:18 +0000 Subject: [PATCH] go: gimme installs new go release --- Makefile | 21 ++++++++++--------- .../ansible/roles/skydive_dev/tasks/gimme.yml | 2 +- packetinjector/pcap.go | 2 +- packetinjector/server.go | 4 ++-- scripts/ci/create-binaries.sh | 2 +- scripts/ci/install-go.sh | 2 +- websocket/message.go | 4 ++-- 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 5f95e49a13..7301c47ace 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,8 @@ endef VERSION?=$(shell $(VERSION_CMD)) GO_GET:=CC= GOARCH= go get -GOVENDOR:=${GOPATH}/bin/govendor +GOFMT:=gofmt -s -w +GOVENDOR:=GOFLAGS= ${GOPATH}/bin/govendor BUILD_CMD?=${GOVENDOR} BUILD_ID:=$(shell echo 0x$$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')) SKYDIVE_GITHUB:=github.com/skydive-project/skydive @@ -281,13 +282,13 @@ flow/flow.pb.go: flow/flow.proto filters/filters.proto sed -e 's/type ICMPLayer struct {/\/\/ gendecoder\ntype ICMPLayer struct {/' -i $@ sed -e 's/type IPMetric struct {/\/\/ gendecoder\ntype IPMetric struct {/' -i $@ sed -e 's/type TCPMetric struct {/\/\/ gendecoder\ntype TCPMetric struct {/' -i $@ - gofmt -s -w $@ + $(GOFMT) $@ websocket/structmessage.pb.go: websocket/structmessage.proto $(call PROTOC_GEN,$<) sed -e 's/type StructMessage struct {/type StructMessage struct { XXX_state structMessageState `json:"-"`/' -i websocket/structmessage.pb.go - gofmt -s -w $@ + $(GOFMT) $@ .proto: govendor flow/layers/dns.pb.go flow/layers/vrrpv2.pb.go flow/layers/dhcpv4.pb.go flow/flow.pb.go filters/filters.pb.go websocket/structmessage.pb.go @@ -354,7 +355,7 @@ npm.install: statics/bindata.go: .typescript ebpf.build $(shell find statics -type f \( ! -iname "bindata.go" \)) $(call VENDOR_RUN,${GO_BINDATA_GITHUB}) go-bindata ${GO_BINDATA_FLAGS} -nometadata -o statics/bindata.go -pkg=statics -ignore=bindata.go $(BINDATA_DIRS) - gofmt -w -s statics/bindata.go + $(GOFMT) statics/bindata.go .PHONY: .vppbinapi .vppbinapi: binapigenerator @@ -558,18 +559,18 @@ govendor: .PHONY: fmt fmt: govendor genlocalfiles @echo "+ $@" - @test -z "$$($(GOVENDOR) fmt +local)" || \ - (echo "+ please format Go code with 'gofmt -s'" && /bin/false) + $(GOVENDOR) fmt +local || \ + (echo "+ please format Go code with '$(GOFMT)'" && /bin/false) .PHONY: vet vet: govendor @echo "+ $@" - test -z "$$($(GOVENDOR) tool vet $$( \ + test -z "$$($(GOVENDOR) vet $$( \ $(GOVENDOR) list -no-status +local \ - | perl -pe 's|$(SKYDIVE_GITHUB)/?||g' \ - | grep -v '^tests') 2>&1 \ + | grep -v '^$(SKYDIVE_GITHUB)/tests' \ + | grep -v '^$(SKYDIVE_GITHUB)/contrib/collectd' \ + ) 2>&1 \ | tee /dev/stderr \ - | grep -v '^flow/probes/afpacket/' \ | grep -v 'exit status 1' \ )" diff --git a/contrib/ansible/roles/skydive_dev/tasks/gimme.yml b/contrib/ansible/roles/skydive_dev/tasks/gimme.yml index a73516eba5..1baeeb85cd 100644 --- a/contrib/ansible/roles/skydive_dev/tasks/gimme.yml +++ b/contrib/ansible/roles/skydive_dev/tasks/gimme.yml @@ -9,7 +9,7 @@ - name: run gimme in bash profile lineinfile: path: /home/vagrant/.bash_profile - line: 'eval "$(gimme 1.10.8)"' + line: 'eval "$(gimme 1.13.0)"' - name: set GOPATH lineinfile: diff --git a/packetinjector/pcap.go b/packetinjector/pcap.go index ce6e856f51..773fee4e83 100644 --- a/packetinjector/pcap.go +++ b/packetinjector/pcap.go @@ -115,6 +115,6 @@ func (p *PcapPacketGenerator) PacketSource() chan *Packet { func NewPcapPacketGenerator(pp *PacketInjectionRequest) (*PcapPacketGenerator, error) { return &PcapPacketGenerator{ PacketInjectionRequest: pp, - close: make(chan bool, 1), + close: make(chan bool, 1), }, nil } diff --git a/packetinjector/server.go b/packetinjector/server.go index 5e72a2a516..687cbb9dcd 100644 --- a/packetinjector/server.go +++ b/packetinjector/server.go @@ -92,8 +92,8 @@ func (o *onDemandPacketInjectServer) CreateTask(srcNode *graph.Node, resource ty metadata := &InjectionMetadata{ PacketInjectionRequest: *pp, - ID: pp.UUID, - State: "active", + ID: pp.UUID, + State: "active", } if o.graph.UpdateMetadata(srcNode, "PacketInjections", func(obj interface{}) bool { diff --git a/scripts/ci/create-binaries.sh b/scripts/ci/create-binaries.sh index e583bbc850..23aace6c5b 100755 --- a/scripts/ci/create-binaries.sh +++ b/scripts/ci/create-binaries.sh @@ -23,7 +23,7 @@ echo "--- BINARIES ---" make static WITH_EBPF=true # We need at least Go 1.11.0 to generate swagger spec -eval "$(gimme 1.12.7)" +eval "$(gimme 1.13.0)" make swagger git reset --hard diff --git a/scripts/ci/install-go.sh b/scripts/ci/install-go.sh index 505cf7ea93..81300331be 100755 --- a/scripts/ci/install-go.sh +++ b/scripts/ci/install-go.sh @@ -14,7 +14,7 @@ curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master chmod +x ~/bin/gimme # before changing this be sure that it will not break the RHEL packaging -eval "$(gimme 1.10.3)" +eval "$(gimme 1.13.0)" export GOPATH=$WORKSPACE export PATH=$PATH:$GOPATH/bin diff --git a/websocket/message.go b/websocket/message.go index 5bde5e39b1..169872cea5 100644 --- a/websocket/message.go +++ b/websocket/message.go @@ -391,7 +391,7 @@ func (s *StructSpeaker) OnMessage(c Speaker, m Message) { func newStructSpeaker(c Speaker, logger logging.Logger) *StructSpeaker { s := &StructSpeaker{ - Speaker: c, + Speaker: c, structSpeakerEventDispatcher: newStructSpeakerEventDispatcher(), nsSubscribed: make(map[string]bool), replyChan: make(map[string]chan *StructMessage), @@ -497,7 +497,7 @@ func (s *StructServer) OnDisconnected(c Speaker) { // NewStructServer returns a new StructServer func NewStructServer(server *Server) *StructServer { s := &StructServer{ - Server: server, + Server: server, structSpeakerPoolEventDispatcher: newStructSpeakerPoolEventDispatcher(server), }