Skip to content

Commit 7fc088f

Browse files
committed
go fmt
1 parent a48ecc1 commit 7fc088f

18 files changed

+66
-67
lines changed

azure-devops-client/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package AzureDevopsClient
22

33
import (
4-
"fmt"
54
"errors"
5+
"fmt"
66
"gopkg.in/resty.v1"
77
"sync/atomic"
88
)
@@ -22,12 +22,12 @@ type AzureDevopsClient struct {
2222
semaphore chan bool
2323
concurrency int64
2424

25-
RequestCount uint64
25+
RequestCount uint64
2626
RequestRetries int
2727

28-
LimitBuildsPerDefinition int64
29-
LimitReleasesPerDefinition int64
30-
LimitDeploymentPerDefinition int64
28+
LimitBuildsPerDefinition int64
29+
LimitReleasesPerDefinition int64
30+
LimitDeploymentPerDefinition int64
3131
LimitReleaseDefinitionsPerProject int64
3232
}
3333

@@ -142,7 +142,7 @@ func (c *AzureDevopsClient) GetCurrentConcurrency() float64 {
142142
return float64(len(c.semaphore))
143143
}
144144

145-
func (c *AzureDevopsClient) checkResponse(response *resty.Response, err error) (error) {
145+
func (c *AzureDevopsClient) checkResponse(response *resty.Response, err error) error {
146146
if err != nil {
147147
return err
148148
}

azure-devops-client/misc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ func int64ToString(v int64) string {
99
return strconv.FormatInt(v, 10)
1010
}
1111

12-
func parseTime(v string) (*time.Time) {
13-
for _, layout := range []string{time.RFC3339Nano,time.RFC3339} {
12+
func parseTime(v string) *time.Time {
13+
for _, layout := range []string{time.RFC3339Nano, time.RFC3339} {
1414
t, err := time.Parse(layout, v)
1515
if err == nil {
1616
return &t

azure-devops-client/pullrequest.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type PullRequest struct {
2727
TargetRefName string
2828

2929
Reviewers []PullRequestReviewer
30-
Labels []PullRequestLabels
30+
Labels []PullRequestLabels
3131

3232
Status string `json:"status"`
3333
CreationDate time.Time
@@ -44,18 +44,18 @@ type PullRequestReviewer struct {
4444
}
4545

4646
type PullRequestLabels struct {
47-
Id string
48-
Name string
47+
Id string
48+
Name string
4949
Active bool
5050
}
5151

5252
type PullRequestVoteSummary struct {
53-
Approved int64
53+
Approved int64
5454
ApprovedSuggestions int64
55-
None int64
56-
WaitingForAuthor int64
57-
Rejected int64
58-
Count int64
55+
None int64
56+
WaitingForAuthor int64
57+
Rejected int64
58+
Count int64
5959
}
6060

6161
func (v *PullRequest) GetVoteSummary() PullRequestVoteSummary {

azure-devops-client/release.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Release struct {
3636
Uri string
3737
Url string
3838

39-
Artifacts []ReleaseArtifact
39+
Artifacts []ReleaseArtifact
4040
Environments []ReleaseEnvironment
4141

4242
RequestedBy IdentifyRef
@@ -47,32 +47,32 @@ type Release struct {
4747

4848
type ReleaseArtifact struct {
4949
SourceId string
50-
Type string
51-
Alias string
50+
Type string
51+
Alias string
5252

5353
DefinitionReference struct {
5454
Definition struct {
55-
Id string
55+
Id string
5656
Name string
5757
}
5858

5959
Project struct {
60-
Id string
60+
Id string
6161
Name string
6262
}
6363

6464
Repository struct {
65-
Id string
65+
Id string
6666
Name string
6767
}
6868

6969
Version struct {
70-
Id string
70+
Id string
7171
Name string
7272
}
7373

7474
Branch struct {
75-
Id string
75+
Id string
7676
Name string
7777
}
7878
}
@@ -90,7 +90,7 @@ type ReleaseEnvironment struct {
9090

9191
DeploySteps []ReleaseEnvironmentDeployStep
9292

93-
PreDeployApprovals []ReleaseEnvironmentApproval
93+
PreDeployApprovals []ReleaseEnvironmentApproval
9494
PostDeployApprovals []ReleaseEnvironmentApproval
9595

9696
CreatedOn time.Time
@@ -125,21 +125,21 @@ type ReleaseEnvironmentDeployStepPhase struct {
125125
}
126126

127127
type ReleaseEnvironmentApproval struct {
128-
Id int64
129-
Revision int64
130-
ApprovalType string
131-
Status string
132-
Comments string
133-
IsAutomated bool
128+
Id int64
129+
Revision int64
130+
ApprovalType string
131+
Status string
132+
Comments string
133+
IsAutomated bool
134134
IsNotificationOn bool
135-
TrialNumber int64
136-
Attempt int64
137-
Rank int64
135+
TrialNumber int64
136+
Attempt int64
137+
Rank int64
138138

139-
Approver IdentifyRef
139+
Approver IdentifyRef
140140
ApprovedBy IdentifyRef
141141

142-
CreatedOn time.Time
142+
CreatedOn time.Time
143143
ModifiedOn time.Time
144144
}
145145

azure-devops-client/release_deployment.go

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
type ReleaseDeploymentList struct {
12-
Count int `json:"count"`
12+
Count int `json:"count"`
1313
List []ReleaseDeployment `json:"value"`
1414
}
1515

@@ -24,27 +24,27 @@ type ReleaseDeployment struct {
2424
} `json:"release"`
2525

2626
ReleaseDefinition struct {
27-
Id int64
28-
Name string
29-
Path string
27+
Id int64
28+
Name string
29+
Path string
3030
} `json:"releaseDefinition"`
3131

3232
Artifacts []ReleaseArtifact
3333

3434
ReleaseEnvironment ReleaseDeploymentEnvironment
3535

36-
PreDeployApprovals []ReleaseEnvironmentApproval
36+
PreDeployApprovals []ReleaseEnvironmentApproval
3737
PostDeployApprovals []ReleaseEnvironmentApproval
3838

39-
Reason string
39+
Reason string
4040
DeploymentStatus string
4141
OperationStatus string
4242

4343
Attempt int64
4444

4545
// sometimes dates are not valid here
46-
QueuedOn string `json:"queuedOn,omitempty"`
47-
StartedOn string `json:"startedOn,omitempty"`
46+
QueuedOn string `json:"queuedOn,omitempty"`
47+
StartedOn string `json:"startedOn,omitempty"`
4848
CompletedOn string `json:"completedOn,omitempty"`
4949

5050
RequestedBy IdentifyRef
@@ -54,12 +54,11 @@ type ReleaseDeployment struct {
5454
}
5555

5656
type ReleaseDeploymentEnvironment struct {
57-
Id int64
58-
Name string
57+
Id int64
58+
Name string
5959
}
6060

61-
62-
func (d *ReleaseDeployment) ApprovedBy() (string) {
61+
func (d *ReleaseDeployment) ApprovedBy() string {
6362
var approverList []string
6463
for _, approval := range d.PreDeployApprovals {
6564
if !approval.IsAutomated {
@@ -69,18 +68,18 @@ func (d *ReleaseDeployment) ApprovedBy() (string) {
6968
}
7069
}
7170

72-
return strings.Join(approverList[:],",")
71+
return strings.Join(approverList[:], ",")
7372
}
7473

75-
func (d *ReleaseDeployment) QueuedOnTime() (*time.Time) {
74+
func (d *ReleaseDeployment) QueuedOnTime() *time.Time {
7675
return parseTime(d.QueuedOn)
7776
}
7877

79-
func (d *ReleaseDeployment) StartedOnTime() (*time.Time) {
78+
func (d *ReleaseDeployment) StartedOnTime() *time.Time {
8079
return parseTime(d.StartedOn)
8180
}
8281

83-
func (d *ReleaseDeployment) CompletedOnTime() (*time.Time) {
82+
func (d *ReleaseDeployment) CompletedOnTime() *time.Time {
8483
return parseTime(d.CompletedOn)
8584
}
8685

azure-devops-client/repository.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ type RepositoryCommit struct {
4747
}
4848

4949
type RepositoryPushList struct {
50-
Count int `json:"count"`
51-
List []RepositoryPush `json:"value"`
50+
Count int `json:"count"`
51+
List []RepositoryPush `json:"value"`
5252
}
5353

5454
type RepositoryPush struct {
55-
PushId int64
55+
PushId int64
5656
}
5757

5858
func (c *AzureDevopsClient) ListRepositories(project string) (list RepositoryList, error error) {

collector_processor_project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
devopsClient "github.com/webdevops/azure-devops-exporter/azure-devops-client"
54
"context"
5+
devopsClient "github.com/webdevops/azure-devops-exporter/azure-devops-client"
66
)
77

88
type CollectorProcessorProjectInterface interface {

collector_project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
devopsClient "github.com/webdevops/azure-devops-exporter/azure-devops-client"
54
"context"
5+
devopsClient "github.com/webdevops/azure-devops-exporter/azure-devops-client"
66
"sync"
77
)
88

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package main
22

33
import (
4-
AzureDevops "github.com/webdevops/azure-devops-exporter/azure-devops-client"
54
"fmt"
65
"github.com/jessevdk/go-flags"
76
"github.com/prometheus/client_golang/prometheus/promhttp"
7+
AzureDevops "github.com/webdevops/azure-devops-exporter/azure-devops-client"
88
"log"
99
"net/http"
1010
"os"

metrics_agentpool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package main
22

33
import (
4-
devopsClient "github.com/webdevops/azure-devops-exporter/azure-devops-client"
54
"context"
65
"github.com/prometheus/client_golang/prometheus"
6+
devopsClient "github.com/webdevops/azure-devops-exporter/azure-devops-client"
77
)
88

99
type MetricsCollectorAgentPool struct {

0 commit comments

Comments
 (0)