diff --git a/os/gfile/gfile_z_example_contents_test.go b/os/gfile/gfile_z_example_contents_test.go index 7f13c6ae5..13e90500c 100644 --- a/os/gfile/gfile_z_example_contents_test.go +++ b/os/gfile/gfile_z_example_contents_test.go @@ -101,7 +101,8 @@ func ExamplePutContentsAppend() { // read contents fmt.Println(gfile.GetContents(tempFile)) - // write contents + // It creates and append content string into specifies file path. + // It automatically creates directory recursively if it does not exist. gfile.PutContentsAppend(tempFile, " append content") // read contents diff --git a/os/gfile/gfile_z_example_replace_test.go b/os/gfile/gfile_z_example_replace_test.go index d9c6935b7..df4d3a931 100644 --- a/os/gfile/gfile_z_example_replace_test.go +++ b/os/gfile/gfile_z_example_replace_test.go @@ -27,6 +27,7 @@ func ExampleReplaceFile() { // read contents fmt.Println(gfile.GetContents(tempFile)) + // It replaces content directly by file path. gfile.ReplaceFile("content", "replace word", tempFile) fmt.Println(gfile.GetContents(tempFile))