Skip to content

Commit 398bcce

Browse files
fix: resolve vet errors, DownloadArtifact bug, and function name typo; add vet target to Makefile
Signed-off-by: Pratik Patil <pratikgpatil1905@gmail.com>
1 parent 38fba26 commit 398bcce

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ build-binaries:
2727

2828
.PHONY: build-watcher
2929
build-watcher:
30-
go build -o ${DIST_DIR}/${BIN_NAME}-${WATCHER_NAME} ${PACKAGE}/watcher
30+
go build -o ${DIST_DIR}/${BIN_NAME}-${WATCHER_NAME} ${PACKAGE}/watcher
31+
32+
.PHONY: vet
33+
vet:
34+
go vet ./...

pkg/connectors/microcks_client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func (c *microcksClient) CreateTestResult(serviceID string, testEndpoint string,
339339
if len(operationsHeaders) > 0 && ensureValidOperationsHeaders(operationsHeaders) {
340340
input += (", \"operationsHeaders\": " + operationsHeaders)
341341
}
342-
if len(oAuth2Context) > 0 && ensureValieOAuth2Context(oAuth2Context) {
342+
if len(oAuth2Context) > 0 && ensureValidOAuth2Context(oAuth2Context) {
343343
input += (", \"oAuth2Context\": " + oAuth2Context)
344344
}
345345

@@ -521,7 +521,7 @@ func (c *microcksClient) DownloadArtifact(artifactURL string, mainArtifact bool,
521521
// Dump response if verbose required.
522522
config.DumpResponseIfRequired("Microcks for uploading artifact", resp, true)
523523

524-
respBody, err := io.ReadAll(req.Body)
524+
respBody, err := io.ReadAll(resp.Body)
525525
if err != nil {
526526
panic(err.Error())
527527
}
@@ -556,7 +556,7 @@ func ensureValidOperationsHeaders(operationsHeaders string) bool {
556556
return true
557557
}
558558

559-
func ensureValieOAuth2Context(oAuth2Context string) bool {
559+
func ensureValidOAuth2Context(oAuth2Context string) bool {
560560
var oContext = OAuth2ClientContext{}
561561
err := json.Unmarshal([]byte(oAuth2Context), &oContext)
562562
if err != nil {

pkg/watcher/executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func TriggerImport(entry config.WatchEntry) {
1212
// Retrieve config to get client options.
1313
cfgPath, err := config.DefaultLocalConfigPath()
1414
if err != nil {
15-
fmt.Errorf("Error while loading config: %s", err.Error())
15+
fmt.Printf("Error while loading config: %s\n", err.Error())
1616
}
1717

1818
fmt.Println("[INFO] Re-importing changed file: " + entry.FilePath)

0 commit comments

Comments
 (0)