diff --git a/Makefile b/Makefile index 11f799a..f5093cf 100644 --- a/Makefile +++ b/Makefile @@ -27,4 +27,8 @@ build-binaries: .PHONY: build-watcher build-watcher: - go build -o ${DIST_DIR}/${BIN_NAME}-${WATCHER_NAME} ${PACKAGE}/watcher \ No newline at end of file + go build -o ${DIST_DIR}/${BIN_NAME}-${WATCHER_NAME} ${PACKAGE}/watcher + +.PHONY: vet +vet: + go vet ./... \ No newline at end of file diff --git a/pkg/connectors/microcks_client.go b/pkg/connectors/microcks_client.go index 4a8d16b..7ee0a1c 100644 --- a/pkg/connectors/microcks_client.go +++ b/pkg/connectors/microcks_client.go @@ -339,7 +339,7 @@ func (c *microcksClient) CreateTestResult(serviceID string, testEndpoint string, if len(operationsHeaders) > 0 && ensureValidOperationsHeaders(operationsHeaders) { input += (", \"operationsHeaders\": " + operationsHeaders) } - if len(oAuth2Context) > 0 && ensureValieOAuth2Context(oAuth2Context) { + if len(oAuth2Context) > 0 && ensureValidOAuth2Context(oAuth2Context) { input += (", \"oAuth2Context\": " + oAuth2Context) } @@ -521,7 +521,7 @@ func (c *microcksClient) DownloadArtifact(artifactURL string, mainArtifact bool, // Dump response if verbose required. config.DumpResponseIfRequired("Microcks for uploading artifact", resp, true) - respBody, err := io.ReadAll(req.Body) + respBody, err := io.ReadAll(resp.Body) if err != nil { panic(err.Error()) } @@ -556,7 +556,7 @@ func ensureValidOperationsHeaders(operationsHeaders string) bool { return true } -func ensureValieOAuth2Context(oAuth2Context string) bool { +func ensureValidOAuth2Context(oAuth2Context string) bool { var oContext = OAuth2ClientContext{} err := json.Unmarshal([]byte(oAuth2Context), &oContext) if err != nil { diff --git a/pkg/watcher/executor.go b/pkg/watcher/executor.go index 3347fc6..069043b 100644 --- a/pkg/watcher/executor.go +++ b/pkg/watcher/executor.go @@ -12,7 +12,7 @@ func TriggerImport(entry config.WatchEntry) { // Retrieve config to get client options. cfgPath, err := config.DefaultLocalConfigPath() if err != nil { - fmt.Errorf("Error while loading config: %s", err.Error()) + fmt.Printf("Error while loading config: %s\n", err.Error()) } fmt.Println("[INFO] Re-importing changed file: " + entry.FilePath)