mirror of
https://github.com/vbatts/go-cgroup.git
synced 2024-11-27 10:55:40 +00:00
Merge pull request #2 from frankscholten/enhancement/sample
Updated sample in documentation
This commit is contained in:
commit
489e2f59f2
1 changed files with 18 additions and 10 deletions
28
README.md
28
README.md
|
@ -16,20 +16,28 @@ on fedora, you'll need packages: golang, libcgroup-devel
|
||||||
Sample
|
Sample
|
||||||
======
|
======
|
||||||
|
|
||||||
|
```
|
||||||
|
package main
|
||||||
|
|
||||||
cgroup.Init()
|
import "github.com/vbatts/go-cgroup"
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
fmt.Println(cgroup.GetSubSysMountPoint("cpu"))
|
func main() {
|
||||||
|
cgroup.Init()
|
||||||
|
|
||||||
ctls, err := cgroup.GetAllControllers()
|
fmt.Println(cgroup.GetSubSysMountPoint("cpu"))
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for i := range ctls {
|
|
||||||
fmt.Println(ctls[i])
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ctls, err := cgroup.GetAllControllers()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for i := range ctls {
|
||||||
|
fmt.Println(ctls[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Contributing
|
Contributing
|
||||||
============
|
============
|
||||||
|
|
Loading…
Reference in a new issue