In this tutorial, We are going to learn about os package in go golang. It provides a platform-independent interface to operating system functionality.
Here, os interface is intended to be uniform across all operating systems.
How to import os package in go golang:
import "os"
It has rich set in functions, variables and constants to interact with the operating system functionality.
Functions:
- Chdir()
- Getwd()
- Hostname()
- Getuid()
- Getppid()
- Getpid()
- Getpagesize()
- Getgroups()
- Getgid()
- Geteuid()
- Getenv()
- Getegid()
- Setenv()
- Clearenv()
- Environ()
- Mkdir()
- Stat()
- Create()
- WriteString()
- Write()
- Rename()
- SameFile()
- fd()
To learn more about golang, Please refer given below link.
https://techieindoor.com/go-lang-tutorial/
References:
https://golang.org/doc/ https://golang.org/pkg/