mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 04:07:47 +08:00
doc: add code comments
This commit is contained in:
parent
dcf5975334
commit
0355ec6b21
@ -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
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user