Skip to content

Commit 5c54f38

Browse files
committed
refactor: improvements in checking apis output
1 parent 406e778 commit 5c54f38

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

apis/util/utils.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,15 @@ func GenerateAPIsInformationMessage(resp *StatusInfo) {
1010
fmt.Printf("Last Update: %s \n", resp.UpdatedAt)
1111
fmt.Println("-------------------")
1212
}
13+
14+
func GenerateBtgAPIsInformationMessage(resp []*StatusInfo) {
15+
fmt.Println("Checking BTG APIs: ")
16+
fmt.Println()
17+
for _, statusInfo := range resp {
18+
fmt.Printf("Checking %s APIs Status \n", statusInfo.Name)
19+
fmt.Printf("Status: %s \n", statusInfo.Description)
20+
fmt.Printf("Last Update: %s \n", statusInfo.UpdatedAt)
21+
fmt.Println()
22+
}
23+
fmt.Println("-------------------")
24+
}

apis/verifyAPIs.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,5 @@ func checkBtgPactualStatus(wg *sync.WaitGroup) {
8181

8282
resp := btgpactual.CheckStatus()
8383

84-
for _, api := range resp {
85-
util.GenerateAPIsInformationMessage(api)
86-
}
84+
util.GenerateBtgAPIsInformationMessage(resp)
8785
}

0 commit comments

Comments
 (0)