Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shamsher31/goisroot
Check if the process is running as root user
https://github.com/shamsher31/goisroot
Last synced: 4 days ago
JSON representation
Check if the process is running as root user
- Host: GitHub
- URL: https://github.com/shamsher31/goisroot
- Owner: shamsher31
- License: mit
- Created: 2015-08-18T17:56:10.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-17T08:16:32.000Z (about 8 years ago)
- Last Synced: 2024-06-21T10:00:11.422Z (5 months ago)
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# goisroot
[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/shamsher31/goisroot)
[![Build Status](https://travis-ci.org/shamsher31/goisroot.svg)](https://travis-ci.org/shamsher31/goisroot)
[![GitHub release](http://img.shields.io/github/release/shamsher31/goisroot.svg?style=flat-square)](release)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](license)Check if the process is running as root user, eg. started with sudo
### How to install
```go
go get github.com/shamsher31/goisroot
```### How to use
```go
package mainimport (
"fmt"
"github.com/shamsher31/goisroot"
)func main() {
fmt.Println(root.Is())
// true
}```
###Aliasing Imports
If you already have package name ```root``` you can use following.
```go
package mainimport (
"fmt"
pckRoot "github.com/shamsher31/goisroot"
)func main() {
fmt.Println(pckRoot.Is())
// true
}
```### Related
[goisdocker](https://github.com/shamsher31/goisdocker)
[goistravis](https://github.com/shamsher31/goistravis)
[goisredirect](https://github.com/shamsher31/goisredirect)### Why
This package is inspired by [is-root](https://www.npmjs.com/package/is-root) npm module.### License
MIT © [Shamsher Ansari](https://github.com/shamsher31)