Skip to content

Commit 82a5ab0

Browse files
committed
Use explicit GOBIN, reorder request error
1 parent 44c9f52 commit 82a5ab0

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Axon also makes it very easy to write sophisicated code that can send date to Co
5151
Axon is distibuted via a Docker container, so to set up your first application in Python you can run:
5252

5353
```
54-
docker run -v "$(pwd)$:/src" ghcr.io/cortexapps/cortex-axon-agent:latest init --language python --name my-cortex-app
54+
docker run -v "$(pwd):/src" ghcr.io/cortexapps/cortex-axon-agent:latest init --language python --name my-cortex-app
5555
```
5656

5757
This will:

agent/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ all: setup proto build test
77
PROTO_FILES := $(wildcard proto/*.proto)
88
GO_FILES := $(patsubst proto/%.proto,$(GENERATED_PATH)/%.pb.go,$(PROTO_FILES))
99

10+
GOPATH ?= $(HOME)/go
11+
GOBIN ?= $(GOPATH)/bin
12+
1013
proto: setup $(GO_FILES)
1114

1215
$(GENERATED_PATH)/%.pb.go: proto/%.proto
@@ -30,20 +33,19 @@ setup:
3033
build:
3134
go build -o axon-agent main.go
3235

33-
3436
mockgen:
3537
mkdir -p test/mocks
36-
@if ! command -v mockgen >/dev/null; then echo "Installing mockgen..."; go install go.uber.org/mock/mockgen@latest; fi
38+
@if ! command -v $(GOBIN)/mockgen >/dev/null; then echo "Installing mockgen..."; go install go.uber.org/mock/mockgen@latest; fi
3739
.PHONY: mockgen
3840

3941
server/http/http_server_mock.go: server/http/http_server.go
4042
@$(MAKE) mockgen
41-
mockgen -package http -destination $@ github.com/cortexapps/axon/server/http Server
43+
$(GOBIN)/mockgen -package http -destination $@ github.com/cortexapps/axon/server/http Server
4244
@echo "Mock $@ generated"
4345

4446
server/snykbroker/registration_mock.go: server/snykbroker/registration.go
4547
@$(MAKE) mockgen
46-
mockgen -package snykbroker -destination $@ github.com/cortexapps/axon/server/snykbroker Registration
48+
$(GOBIN)/mockgen -package snykbroker -destination $@ github.com/cortexapps/axon/server/snykbroker Registration
4749
@echo "Mock $@ generated"
4850

4951
mocks: server/http/http_server_mock.go server/snykbroker/registration_mock.go

agent/server/snykbroker/registration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ func (r *registration) Register(integration common.Integration, alias string) (*
7373
}
7474

7575
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonBody))
76-
req.Header.Set("Content-Type", "application/json")
77-
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", r.config.CortexApiToken))
7876
if err != nil {
7977
fmt.Printf("Error creating request: %v\n", err)
8078
panic(err)
8179
}
80+
req.Header.Set("Content-Type", "application/json")
81+
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", r.config.CortexApiToken))
8282

8383
resp, err := client.Do(req)
8484
if err == net.ErrClosed {

0 commit comments

Comments
 (0)