github.com/gogf/gf/v2@v2.7.4/os/gfile/gfile_z_example_home_test.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package gfile_test
     8  
     9  import (
    10  	"fmt"
    11  
    12  	"github.com/gogf/gf/v2/os/gfile"
    13  )
    14  
    15  func ExampleHome() {
    16  	// user's home directory
    17  	homePath, _ := gfile.Home()
    18  	fmt.Println(homePath)
    19  
    20  	// May Output:
    21  	// C:\Users\hailaz
    22  }