Last active
September 27, 2020 04:57
-
-
Save hnts/7656345fdb59a4be5979d5338d0d893d to your computer and use it in GitHub Desktop.
Output UserID and Effective User ID
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()) // 実ユーザID | |
fmt.Printf("Group ID: %d\n", os.Getgid()) | |
fmt.Printf("Effective User ID: %d\n", os.Geteuid()) // 実効ユーザID | |
fmt.Printf("Effective Group ID: %d\n", os.Getegid()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment