Last active
September 23, 2020 13:43
-
-
Save hnts/0d71279575ea91e60b116d1423bd971f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func main() { | |
fmt.Printf("User ID: %d\n", os.Getuid()) | |
fmt.Printf("Group ID: %d\n", os.Getgid()) | |
fmt.Printf("Effective User ID: %d\n", os.Geteuid()) | |
fmt.Printf("Effective Group ID: %d\n", os.Getegid()) | |
// Open a hnts2's file | |
f, err := os.Open("test.txt") | |
if err != nil { | |
fmt.Println(err) | |
} | |
defer f.Close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment