Skip to content

Commit dbab803

Browse files
committed
Run go fmt
1 parent 3c99d32 commit dbab803

File tree

15 files changed

+56
-69
lines changed

15 files changed

+56
-69
lines changed

core/authentication/jwt_backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
expireOffset = 3600
2323
)
2424

25-
//Token - container for jwt.Token for encoding
25+
// Token - container for jwt.Token for encoding
2626
type Token struct {
2727
Token *jwt.Token
2828
}

core/cmd/hoverfly/main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,6 @@ func main() {
446446
cfg.Destination = *destination
447447
}
448448

449-
450449
if len(responseBodyFilesPath) > 0 {
451450
// Ensure file path is absolute and exists in the file system
452451
if !filepath.IsAbs(responseBodyFilesPath) {
@@ -463,8 +462,6 @@ func main() {
463462
cfg.ResponsesBodyFilesPath = absBasePath
464463
}
465464

466-
467-
468465
for _, allowedOrigin := range responseBodyFilesAllowedOriginFlags {
469466
if !util.IsURL(allowedOrigin) {
470467
log.WithFields(log.Fields{"origin": allowedOrigin}).Fatal("Origin is not a valid url")

core/hoverfly_service_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,11 +1525,11 @@ func TestHoverfly_SetMultipleTemplateDataSource(t *testing.T) {
15251525

15261526
Expect(unit.templator.TemplateHelper.TemplateDataSource.GetAllDataSources()).ToNot(BeNil())
15271527

1528-
csv1, exists1:= unit.templator.TemplateHelper.TemplateDataSource.GetDataSource("test-csv1")
1528+
csv1, exists1 := unit.templator.TemplateHelper.TemplateDataSource.GetDataSource("test-csv1")
15291529
Expect(csv1).NotTo(BeNil())
15301530
Expect(exists1).To(BeTrue())
15311531

1532-
csv2, exists2:= unit.templator.TemplateHelper.TemplateDataSource.GetDataSource("test-csv2")
1532+
csv2, exists2 := unit.templator.TemplateHelper.TemplateDataSource.GetDataSource("test-csv2")
15331533
Expect(csv2).NotTo(BeNil())
15341534
Expect(exists2).To(BeTrue())
15351535

core/journal/journal_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func Test_Journal_NewEntryWithMemoryLimit_TruncateBody(t *testing.T) {
8282
unit := journal.NewJournal()
8383
unit.BodySizeLimit = 15
8484

85-
request, _ := http.NewRequest("GET", "http://hoverfly.io", io.NopCloser(bytes.NewBufferString("large request body")),)
85+
request, _ := http.NewRequest("GET", "http://hoverfly.io", io.NopCloser(bytes.NewBufferString("large request body")))
8686

8787
nowTime := time.Now()
8888

@@ -112,7 +112,6 @@ func Test_Journal_NewEntryWithMemoryLimit_TruncateBody(t *testing.T) {
112112
Expect(entries[0].Response.Body).To(Equal("large respon..."))
113113
}
114114

115-
116115
func Test_Journal_UpdateEntry_AddsRemotePostServeActionToJournalEntry(t *testing.T) {
117116
RegisterTestingT(t)
118117

core/matching/header_matcher_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ func Test_HeaderMatching(t *testing.T) {
178178

179179
}
180180

181-
182181
func Test_HeaderMatching_NotModifyingOriginalRequestHeaders(t *testing.T) {
183182
RegisterTestingT(t)
184183

core/modes/modes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func Test_ReconstructRequest_ShouldRecompressGzipBody(t *testing.T) {
9090
Method: "POST",
9191
Destination: "test-destination.com",
9292
Body: "new request body here",
93-
Headers: map[string][]string{"Content-Encoding": {"gzip"}},
93+
Headers: map[string][]string{"Content-Encoding": {"gzip"}},
9494
}
9595
pair := models.RequestResponsePair{Request: request}
9696

core/statik/statik.go

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/util/memory_size.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,3 @@ func (m *MemorySize) Set(value string) error {
5050
*m = MemorySize(size * multiplier)
5151
return nil
5252
}
53-

core/util/util.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ func convertToPlainNotation(scientific string) (string, bool) {
440440
return scientific, false
441441
}
442442

443-
return floatVal.Text('f', -1) , true
443+
return floatVal.Text('f', -1), true
444444
}
445445

446446
func xPath(query, toMatch string) string {
@@ -573,7 +573,7 @@ func TruncateStringWithEllipsis(input string, maxSize int) string {
573573
return ellipsis
574574
}
575575

576-
if len(input) <= maxSize{
576+
if len(input) <= maxSize {
577577
return input
578578
}
579579

@@ -586,4 +586,3 @@ func TruncateStringWithEllipsis(input string, maxSize int) string {
586586

587587
return truncated + ellipsis
588588
}
589-

core/util/util_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ func TestResolveAndValidatePath(t *testing.T) {
417417
}
418418
}
419419

420-
421420
func TestTruncateStringWithEllipsis(t *testing.T) {
422421

423422
tests := []struct {
@@ -484,5 +483,3 @@ func TestTruncateStringWithEllipsis(t *testing.T) {
484483
})
485484
}
486485
}
487-
488-

0 commit comments

Comments
 (0)