doc: add code comments

This commit is contained in:
hailaz 2021-11-19 09:53:32 +08:00
parent dcf5975334
commit 0355ec6b21
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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))