Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: client/cmd/isolated/common.go

Issue 1149823004: Set GOMAXPROCS=runtime.NumCPU(). (Closed) Base URL: git@github.com:luci/luci-go@4_drop_tid
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « client/cmd/isolate/common.go ('k') | client/cmd/swarming/common.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "runtime"
9
8 "github.com/luci/luci-go/client/internal/common" 10 "github.com/luci/luci-go/client/internal/common"
9 "github.com/luci/luci-go/client/isolatedclient" 11 "github.com/luci/luci-go/client/isolatedclient"
10 "github.com/maruel/subcommands" 12 "github.com/maruel/subcommands"
11 ) 13 )
12 14
15 func init() {
16 runtime.GOMAXPROCS(runtime.NumCPU())
17 }
18
13 type commonFlags struct { 19 type commonFlags struct {
14 subcommands.CommandRunBase 20 subcommands.CommandRunBase
15 defaultFlags common.Flags 21 defaultFlags common.Flags
16 isolatedFlags isolatedclient.Flags 22 isolatedFlags isolatedclient.Flags
17 } 23 }
18 24
19 func (c *commonFlags) Init() { 25 func (c *commonFlags) Init() {
20 c.defaultFlags.Init(&c.Flags) 26 c.defaultFlags.Init(&c.Flags)
21 c.isolatedFlags.Init(&c.Flags) 27 c.isolatedFlags.Init(&c.Flags)
22 } 28 }
23 29
24 func (c *commonFlags) Parse() error { 30 func (c *commonFlags) Parse() error {
25 if err := c.defaultFlags.Parse(); err != nil { 31 if err := c.defaultFlags.Parse(); err != nil {
26 return err 32 return err
27 } 33 }
28 return c.isolatedFlags.Parse() 34 return c.isolatedFlags.Parse()
29 } 35 }
30 36
31 func (c *commonFlags) Close() error { 37 func (c *commonFlags) Close() error {
32 err := c.defaultFlags.Close() 38 err := c.defaultFlags.Close()
33 if err2 := c.isolatedFlags.Close(); err == nil { 39 if err2 := c.isolatedFlags.Close(); err == nil {
34 err = err2 40 err = err2
35 } 41 }
36 return err 42 return err
37 } 43 }
OLDNEW
« no previous file with comments | « client/cmd/isolate/common.go ('k') | client/cmd/swarming/common.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698