1
0
Fork 0
mirror of https://github.com/vbatts/go-cgroup.git synced 2024-11-23 09:05:39 +00:00

Merge pull request #2 from frankscholten/enhancement/sample

Updated sample in documentation
This commit is contained in:
Vincent Batts 2016-02-19 10:51:09 -05:00
commit 489e2f59f2

View file

@ -16,20 +16,28 @@ on fedora, you'll need packages: golang, libcgroup-devel
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()
if err != nil {
fmt.Println(err)
return
}
for i := range ctls {
fmt.Println(ctls[i])
}
fmt.Println(cgroup.GetSubSysMountPoint("cpu"))
ctls, err := cgroup.GetAllControllers()
if err != nil {
fmt.Println(err)
return
}
for i := range ctls {
fmt.Println(ctls[i])
}
}
```
Contributing
============