Skip to content

Commit 10e0f9f

Browse files
committed
Fix lint issues
1 parent 151a2ce commit 10e0f9f

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

filet.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import (
77
"testing"
88
)
99

10-
// Keeps track of files that we've used so we can clean up.
10+
// Files keeps track of files that we've used so we can clean up.
1111
var Files []string
12-
var appFs afero.Fs = afero.NewOsFs()
12+
var appFs = afero.NewOsFs()
1313

1414
/*
15-
Creates a tmp directory for us to use.
15+
TmpDir Creates a tmp directory for us to use.
1616
*/
1717
func TmpDir(t *testing.T, dir string) string {
1818
name, err := afero.TempDir(appFs, dir, "dir")
@@ -25,7 +25,7 @@ func TmpDir(t *testing.T, dir string) string {
2525
}
2626

2727
/*
28-
Creates a tmp file for us to use when testing
28+
TmpFile Creates a tmp file for us to use when testing
2929
*/
3030
func TmpFile(t *testing.T, dir string, content string) afero.File {
3131
file, err := afero.TempFile(appFs, dir, "file")
@@ -40,7 +40,8 @@ func TmpFile(t *testing.T, dir string, content string) afero.File {
4040
}
4141

4242
/*
43-
Returns true if the file at the path contains the expected byte array content.
43+
FileSays returns true if the file at the path contains the expected byte array
44+
content.
4445
*/
4546
func FileSays(t *testing.T, path string, expected []byte) bool {
4647
content, err := afero.ReadFile(appFs, path)
@@ -52,7 +53,7 @@ func FileSays(t *testing.T, path string, expected []byte) bool {
5253
}
5354

5455
/*
55-
Removes all files in our test registry and calls `t.Error` if something goes
56+
CleanUp removes all files in our test registry and calls `t.Error` if something goes
5657
wrong.
5758
*/
5859
func CleanUp(t *testing.T) {
@@ -66,7 +67,7 @@ func CleanUp(t *testing.T) {
6667
}
6768

6869
/*
69-
Returns true if the file exists. Calls t.Error if something goes wrong while
70+
Exists returns true if the file exists. Calls t.Error if something goes wrong while
7071
checking.
7172
*/
7273
func Exists(t *testing.T, path string) bool {
@@ -78,8 +79,8 @@ func Exists(t *testing.T, path string) bool {
7879
}
7980

8081
/*
81-
Returns true if the dir contains the path. Calls t.Error if something goes wrong while
82-
checking.
82+
DirContains returns true if the dir contains the path. Calls t.Error if
83+
something goes wrong while checking.
8384
*/
8485
func DirContains(t *testing.T, dir string, path string) bool {
8586
fullPath := filepath.Join(dir, path)

filet_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ func TestTmpFile(t *testing.T) {
3232
func TestFileSays(t *testing.T) {
3333
defer CleanUp(t)
3434

35-
file := TmpFile(t, "", "Ghandi")
36-
assert.Equal(t, FileSays(t, file.Name(), []byte("Ghandi")), true,
35+
file := TmpFile(t, "", "Gandhi")
36+
assert.Equal(t, FileSays(t, file.Name(), []byte("Gandhi")), true,
3737
"FileSays can correctly read a file.")
3838
assert.Equal(t, FileSays(t, file.Name(), []byte("nope!")), false,
3939
"FileSays can correctly tell when a file does not contain content.")

0 commit comments

Comments
 (0)