Skip to content

Commit 5ce3479

Browse files
enabled goimports (#97)
1 parent b54cef5 commit 5ce3479

File tree

7 files changed

+17
-14
lines changed

7 files changed

+17
-14
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ linters:
77
- govet
88
- staticcheck
99
- errcheck
10+
- goimports

fake/fake.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ package fake
66
import (
77
"crypto/rand"
88
"fmt"
9-
rnd "github.com/kashifkhan0771/utils/rand"
109
"io"
1110
"time"
11+
12+
rnd "github.com/kashifkhan0771/utils/rand"
1213
)
1314

1415
const (
@@ -108,10 +109,10 @@ func RandomAddress() (string, error) {
108109
state := states[idx]
109110

110111
idx, err = rnd.NumberInRange(0, int64(len(postalCodes)-1))
111-
if err != nil {
112-
return "", err
113-
}
114-
postalCode := postalCodes[idx]
112+
if err != nil {
113+
return "", err
114+
}
115+
postalCode := postalCodes[idx]
115116

116-
return fmt.Sprintf("%d %s, %s, %s %s, USA", streetNumber, streetName, city, state, postalCode), nil
117+
return fmt.Sprintf("%d %s, %s, %s %s, USA", streetNumber, streetName, city, state, postalCode), nil
117118
}

fake/fake_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ func TestGenerateUUID(t *testing.T) {
1616
t.Fatalf("Expected no error, got %v", err)
1717
}
1818

19-
// Test if UUID is of correct length
19+
// Test if UUID is of correct length
2020
if len(uuid) != 36 {
2121
t.Errorf("Expected length 36, got %d", len(uuid))
2222
}
2323

24-
// Test if UUID matches the correct format
24+
// Test if UUID matches the correct format
2525
isValidUUID := regexp.MustCompile(`^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$`).MatchString
2626
if !isValidUUID(uuid) {
2727
t.Errorf("UUID %s does not match the required format", uuid)
2828
}
2929

30-
// Test for uniqueness
30+
// Test for uniqueness
3131
if _, exists := uuidSet[uuid]; exists {
3232
t.Errorf("Duplicate UUID found: %s", uuid)
3333
}

fsutils/fsutils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ func DirsIdentical(dir1, dir2 string) (bool, error) {
160160
}
161161

162162
type result struct {
163-
path string
163+
path string
164164
identical bool
165-
err error
165+
err error
166166
}
167167

168168
workers := make(chan struct{}, 10)

fsutils/fsutils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func TestFindFiles(t *testing.T) {
140140
if err := os.Chmod(tempDir, 0000); err != nil {
141141
t.Fatal(err)
142142
}
143-
143+
144144
defer func() {
145145
if err := os.Chmod(tempDir, 0755); err != nil {
146146
t.Errorf("Failed to restore directory permissions: %v", err)

templates/html_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
func normalizeWhitespace(input string) string {
1313
// Remove leading and trailing whitespace
1414
input = strings.TrimSpace(input)
15-
15+
1616
// Normalize whitespace by replacing multiple spaces and newlines with a single space
1717
whitespace := regexp.MustCompile(`\s+`)
1818
input = whitespace.ReplaceAllString(input, " ")

url/url.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ package url
55

66
import (
77
"errors"
8-
"golang.org/x/net/publicsuffix"
98
"net/url"
109
"regexp"
1110
"strings"
11+
12+
"golang.org/x/net/publicsuffix"
1213
)
1314

1415
// BuildURL constructs a URL by combining a scheme, host, path, and query parameters.

0 commit comments

Comments
 (0)