- commit
- c454017
- parent
- 5c8d929
- author
- Antonio Mika
- date
- 2025-02-23 10:07:56 -0500 EST
Fix lint
5 files changed,
+15,
-18
+0,
-1
1@@ -229,7 +229,6 @@ func calcRoutes(projectName, fp string, userRedirects []*RedirectRule) []*HttpRe
2 case "none":
3 fallthrough
4 default:
5- break
6 }
7
8 if len(match) > 0 && match[0] != "" {
+1,
-1
1@@ -650,7 +650,7 @@ func TestCalcRoutes(t *testing.T) {
2 t.Run(fixture.Name, func(t *testing.T) {
3 if cmp.Equal(fixture.Actual, fixture.Expected) == false {
4 //nolint
5- t.Fatalf(cmp.Diff(fixture.Expected, fixture.Actual))
6+ t.Fatal(cmp.Diff(fixture.Expected, fixture.Actual))
7 }
8 })
9 }
+1,
-1
1@@ -173,7 +173,7 @@ func TestParseHeaderText(t *testing.T) {
2 fmt.Println(results)
3 if cmp.Equal(results, fixture.expect) == false {
4 //nolint
5- t.Fatalf(cmp.Diff(fixture.expect, results))
6+ t.Fatal(cmp.Diff(fixture.expect, results))
7 }
8 })
9 }
+1,
-1
1@@ -109,7 +109,7 @@ func TestParseRedirectText(t *testing.T) {
2 }
3 if cmp.Equal(results, fixture.expect) == false {
4 //nolint
5- t.Fatalf(cmp.Diff(fixture.expect, results))
6+ t.Fatal(cmp.Diff(fixture.expect, results))
7 }
8 })
9 }
+12,
-14
1@@ -130,12 +130,18 @@ func TestSshServerRsync(t *testing.T) {
2 keyFile,
3 pem.EncodeToMemory(block), 0600,
4 )
5+ if err != nil {
6+ t.Fatal(err)
7+ }
8
9 index := "<!doctype html><html><body>index</body></html>"
10 err = os.WriteFile(
11 filepath.Join(name, "index.html"),
12 []byte(index), 0666,
13 )
14+ if err != nil {
15+ t.Fatal(err)
16+ }
17
18 about := "<!doctype html><html><body>about</body></html>"
19 aboutFile := filepath.Join(name, "about.html")
20@@ -143,12 +149,18 @@ func TestSshServerRsync(t *testing.T) {
21 aboutFile,
22 []byte(about), 0666,
23 )
24+ if err != nil {
25+ t.Fatal(err)
26+ }
27
28 contact := "<!doctype html><html><body>contact</body></html>"
29 err = os.WriteFile(
30 filepath.Join(name, "contact.html"),
31 []byte(contact), 0666,
32 )
33+ if err != nil {
34+ t.Fatal(err)
35+ }
36
37 eCmd := fmt.Sprintf(
38 "ssh -p 2222 -o IdentitiesOnly=yes -i %s -o StrictHostKeyChecking=no",
39@@ -193,20 +205,6 @@ func TestSshServerRsync(t *testing.T) {
40 done <- nil
41 }
42
43-func createTmpFile(name, contents, ext string) *os.File {
44- file, err := os.CreateTemp("tmp", fmt.Sprintf("%s-*.%s", name, ext))
45- if err != nil {
46- panic(err)
47- }
48-
49- data := []byte(contents)
50- if _, err := file.Write(data); err != nil {
51- panic(err)
52- }
53-
54- return file
55-}
56-
57 type UserSSH struct {
58 username string
59 signer ssh.Signer