Skip to content

Commit

Permalink
Correct format of code style.
Browse files Browse the repository at this point in the history
Signed-off-by: linzhinan(zen Lin) <linzhinan@huawei.com>
  • Loading branch information
zenlint committed Mar 31, 2016
1 parent 37b9346 commit 5e909b5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
4 changes: 0 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ func init() {

rd := bufio.NewReader(f)
count := 0

for {

line, err := rd.ReadString('\n')
if err != nil || io.EOF == err {
break
}

prefix := strings.Split(line, "=")
caseName := strings.TrimSpace(prefix[0])
caseArg := strings.TrimPrefix(line, caseName+"=")
Expand All @@ -47,7 +44,6 @@ func init() {
}

func splitArgs(args string) []string {

argArray := strings.Split(args, ";")
resArray := make([]string, len(argArray))
for count, arg := range argArray {
Expand Down
6 changes: 2 additions & 4 deletions runtimetest.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const bundleCacheDir = "./bundles"
var runtimetestFlags = []cli.Flag{
cli.StringFlag{Name: "runtime, r", Usage: "runtime to be tested"},
cli.StringFlag{Name: "output, o", Usage: "output format, \n" +
"-o=all: ouput sucessful details and statics, -o=err-only: ouput failure details and statics"},
"-o=all: ouput sucessful details and statistics, -o=err-only: ouput failure details and statics"},
cli.BoolFlag{Name: "debug, d", Usage: "switch of debug mode, defaults to false, with '--debug' to enable debug mode"},
}

Expand All @@ -22,13 +22,12 @@ var runtimeTestCommand = cli.Command{
Usage: "test if a runtime is comlpliant to oci specs",
Flags: runtimetestFlags,
Action: func(context *cli.Context) {

if os.Geteuid() != 0 {
logrus.Fatalln("runtimetest should be run as root")
}
var runtime string
if runtime = context.String("runtime"); runtime != "runc" {
logrus.Fatalf("runtimetest have not support %v\n", runtime)
logrus.Fatalf("runtimetest does not support %v\n", runtime)
}
output := context.String("output")
setDebugMode(context.Bool("debug"))
Expand Down Expand Up @@ -57,7 +56,6 @@ var runtimeTestCommand = cli.Command{
if err := os.Remove("./config.json"); err != nil {
logrus.Fatalf("remove ./config.json err: %v\n", err)
}

},
}

Expand Down
3 changes: 0 additions & 3 deletions units/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,11 @@ func runcStart(specDir string) (string, error) {
if err != nil {
return string(out), errors.New(string(out) + err.Error())
}

return string(out), nil
}

func splitArgs(args string) []string {

argsnew := strings.TrimSpace(args)

argArray := strings.Split(argsnew, "--")

length := len(argArray)
Expand Down

0 comments on commit 5e909b5

Please sign in to comment.