From ebdd7269fd9219493b82c7556890e1c5b9289f05 Mon Sep 17 00:00:00 2001 From: Frank Scholten Date: Fri, 19 Feb 2016 16:07:11 +0100 Subject: [PATCH] Updated sample in documentation --- README.md | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 000ce2b..b1babaa 100644 --- a/README.md +++ b/README.md @@ -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 ============