Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo flie -> file #3228

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion os/gfile/gfile_z_example_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
func ExampleGetContentsWithCache() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_cache")
tempFile = gfile.Join(tempDir, fileName)
)
Expand Down
22 changes: 11 additions & 11 deletions os/gfile/gfile_z_example_contents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func ExampleGetContents() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -34,7 +34,7 @@ func ExampleGetContents() {
func ExampleGetBytes() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -53,7 +53,7 @@ func ExampleGetBytes() {
func ExamplePutContents() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -72,7 +72,7 @@ func ExamplePutContents() {
func ExamplePutBytes() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -90,7 +90,7 @@ func ExamplePutBytes() {
func ExamplePutContentsAppend() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -116,7 +116,7 @@ func ExamplePutContentsAppend() {
func ExamplePutBytesAppend() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -141,7 +141,7 @@ func ExamplePutBytesAppend() {
func ExampleGetNextCharOffsetByPath() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -160,7 +160,7 @@ func ExampleGetNextCharOffsetByPath() {
func ExampleGetBytesTilCharByPath() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -178,7 +178,7 @@ func ExampleGetBytesTilCharByPath() {
func ExampleGetBytesByTwoOffsetsByPath() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -196,7 +196,7 @@ func ExampleGetBytesByTwoOffsetsByPath() {
func ExampleReadLines() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -219,7 +219,7 @@ func ExampleReadLines() {
func ExampleReadLinesBytes() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_content")
tempFile = gfile.Join(tempDir, fileName)
)
Expand Down
8 changes: 4 additions & 4 deletions os/gfile/gfile_z_example_copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
func ExampleCopy() {
// init
var (
srcFileName = "gflie_example.txt"
srcFileName = "gfile_example.txt"
srcTempDir = gfile.Temp("gfile_example_copy_src")
srcTempFile = gfile.Join(srcTempDir, srcFileName)

// copy file
dstFileName = "gflie_example_copy.txt"
dstFileName = "gfile_example_copy.txt"
dstTempFile = gfile.Join(srcTempDir, dstFileName)

// copy dir
Expand All @@ -47,6 +47,6 @@ func ExampleCopy() {

// Output:
// goframe example copy
// gflie_example.txt
// gflie_example_copy.txt
// gfile_example.txt
// gfile_example_copy.txt
}
12 changes: 6 additions & 6 deletions os/gfile/gfile_z_example_replace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
func ExampleReplaceFile() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_replace")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -40,7 +40,7 @@ func ExampleReplaceFile() {
func ExampleReplaceFileFunc() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_replace")
tempFile = gfile.Join(tempDir, fileName)
)
Expand Down Expand Up @@ -68,7 +68,7 @@ func ExampleReplaceFileFunc() {
func ExampleReplaceDir() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_replace")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -80,7 +80,7 @@ func ExampleReplaceDir() {
fmt.Println(gfile.GetContents(tempFile))

// It replaces content of all files under specified directory recursively.
gfile.ReplaceDir("content", "replace word", tempDir, "gflie_example.txt", true)
gfile.ReplaceDir("content", "replace word", tempDir, "gfile_example.txt", true)

// read contents
fmt.Println(gfile.GetContents(tempFile))
Expand All @@ -93,7 +93,7 @@ func ExampleReplaceDir() {
func ExampleReplaceDirFunc() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_replace")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -109,7 +109,7 @@ func ExampleReplaceDirFunc() {
// Replace with regular match
reg, _ := regexp.Compile(`\d{3}`)
return reg.ReplaceAllString(content, "[num]")
}, tempDir, "gflie_example.txt", true)
}, tempDir, "gfile_example.txt", true)

fmt.Println(gfile.GetContents(tempFile))

Expand Down
26 changes: 13 additions & 13 deletions os/gfile/gfile_z_example_scan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func ExampleScanDir() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_scan_dir")
tempFile = gfile.Join(tempDir, fileName)

Expand All @@ -34,15 +34,15 @@ func ExampleScanDir() {
}

// Output:
// gflie_example.txt
// gfile_example.txt
// sub_dir
// gflie_example.txt
// gfile_example.txt
}

func ExampleScanDirFile() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_scan_dir_file")
tempFile = gfile.Join(tempDir, fileName)

Expand All @@ -61,14 +61,14 @@ func ExampleScanDirFile() {
}

// Output:
// gflie_example.txt
// gflie_example.txt
// gfile_example.txt
// gfile_example.txt
}

func ExampleScanDirFunc() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_scan_dir_func")
tempFile = gfile.Join(tempDir, fileName)

Expand All @@ -83,7 +83,7 @@ func ExampleScanDirFunc() {
// scans directory recursively
list, _ := gfile.ScanDirFunc(tempDir, "*", true, func(path string) string {
// ignores some files
if gfile.Basename(path) == "gflie_example.txt" {
if gfile.Basename(path) == "gfile_example.txt" {
return ""
}
return path
Expand All @@ -99,11 +99,11 @@ func ExampleScanDirFunc() {
func ExampleScanDirFileFunc() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_scan_dir_file_func")
tempFile = gfile.Join(tempDir, fileName)

fileName1 = "gflie_example_ignores.txt"
fileName1 = "gfile_example_ignores.txt"
tempFile1 = gfile.Join(tempDir, fileName1)

tempSubDir = gfile.Join(tempDir, "sub_dir")
Expand All @@ -118,7 +118,7 @@ func ExampleScanDirFileFunc() {
// scans directory recursively exclusive of directories
list, _ := gfile.ScanDirFileFunc(tempDir, "*.txt", true, func(path string) string {
// ignores some files
if gfile.Basename(path) == "gflie_example_ignores.txt" {
if gfile.Basename(path) == "gfile_example_ignores.txt" {
return ""
}
return path
Expand All @@ -128,6 +128,6 @@ func ExampleScanDirFileFunc() {
}

// Output:
// gflie_example.txt
// gflie_example.txt
// gfile_example.txt
// gfile_example.txt
}
4 changes: 2 additions & 2 deletions os/gfile/gfile_z_example_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func ExampleSearch() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_search")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -28,5 +28,5 @@ func ExampleSearch() {
fmt.Println(gfile.Basename(realPath))

// Output:
// gflie_example.txt
// gfile_example.txt
}
6 changes: 3 additions & 3 deletions os/gfile/gfile_z_example_size_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func ExampleSize() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_size")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -31,7 +31,7 @@ func ExampleSize() {
func ExampleSizeFormat() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_size")
tempFile = gfile.Join(tempDir, fileName)
)
Expand All @@ -47,7 +47,7 @@ func ExampleSizeFormat() {
func ExampleReadableSize() {
// init
var (
fileName = "gflie_example.txt"
fileName = "gfile_example.txt"
tempDir = gfile.Temp("gfile_example_size")
tempFile = gfile.Join(tempDir, fileName)
)
Expand Down