Getwd functionis used to get the current working directory in Golang, the function returns the rooted path name and if the current directory can be reached via multiple paths, the function can return any one of them.
func Getwd()(dir string, err error)
The func returns two things the directory and also error, if there is no error it returns nil.
You may get different outputs on online compilers. For better understanding, use the offline compiler.
- How to Get Current Weekday in Golang?
- How to Get Current time in Golang?
- How Many Logical Processors Used By Current Process in Golang?
- How to Get Current Date and Time in Various Format in Golang?
- Getting the current date and time with timestamp in local and other timezones in Golang
- Copy the entire contents of a directory to another directory in PHP
- How to Zip a directory in PHP?
- How to include() all PHP files from a directory ?
- How to count files in a directory using PHP?
- How to copy a file from one directory to another using PHP ?
- How to see the changes in whole directory/folder containing many sass files ?
- Why PHP script does not create a directory with 777 permissions ?
- How to keep compiled files in a separate directory ?
- How to display all files in a directory using Node.js ?
- How to check the given path is file or directory in node.js ?
- Perl | Accessing a Directory using File Globbing
- How to recursively delete a directory and its entire contents (files + sub dirs) in PHP?
- Working on Git for GUI
- Working on BitBucket using Git
- Working on Git Bash
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.