diff options
author | David Symonds <dsymonds@golang.org> | 2012-02-22 15:46:31 +1100 |
---|---|---|
committer | David Symonds <dsymonds@golang.org> | 2012-02-22 15:46:31 +1100 |
commit | d4fe6026b515db4637c3db5621bda36298b2fbdc (patch) | |
tree | 93df1ea4b65c78a520af8c4fe8abff74cbdde7e7 /src/cmd/fix | |
parent | ff6cfae414b793a0281aed7e54d43722bf711384 (diff) | |
download | go-d4fe6026b515db4637c3db5621bda36298b2fbdc.tar.gz |
cmd/fix: remove os.Wait gofix.
The os.Wait function has been removed entirely, so there's no point in fixing code that called it.
R=r
CC=golang-dev
http://codereview.appspot.com/5685078
Diffstat (limited to 'src/cmd/fix')
-rw-r--r-- | src/cmd/fix/oswait.go | 56 | ||||
-rw-r--r-- | src/cmd/fix/oswait_test.go | 41 |
2 files changed, 0 insertions, 97 deletions
diff --git a/src/cmd/fix/oswait.go b/src/cmd/fix/oswait.go deleted file mode 100644 index fdc23f853..000000000 --- a/src/cmd/fix/oswait.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "go/ast" -) - -func init() { - register(oswaitFix) -} - -var oswaitFix = fix{ - "oswait", - "2012-02-20", - oswait, - `Delete options from os.Wait. If the option is the literal 0, rewrite the call. - -http://codereview.appspot.com/5688046 -`, -} - -func oswait(f *ast.File) bool { - if !imports(f, "os") { - return false - } - - fixed := false - - walk(f, func(n interface{}) { - call, ok := n.(*ast.CallExpr) - if !ok { - return - } - if !isPkgDot(call.Fun, "os", "Wait") { - return - } - args := call.Args - const warning = "call to Process.Wait must be fixed manually" - if len(args) != 1 { - // Shouldn't happen, but check. - warn(call.Pos(), warning) - return - } - if basicLit, ok := args[0].(*ast.BasicLit); !ok || basicLit.Value != "0" { - warn(call.Pos(), warning) - return - } - call.Args = nil - fixed = true - }) - - return fixed -} diff --git a/src/cmd/fix/oswait_test.go b/src/cmd/fix/oswait_test.go deleted file mode 100644 index baff01748..000000000 --- a/src/cmd/fix/oswait_test.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -func init() { - addTestCases(oswaitTests, oswait) -} - -var oswaitTests = []testCase{ - { - Name: "oswait.0", - In: `package main - -import ( - "os" -) - -func f() { - os.Wait() - os.Wait(0) - os.Wait(1) - os.Wait(A | B) -} -`, - Out: `package main - -import ( - "os" -) - -func f() { - os.Wait() - os.Wait() - os.Wait(1) - os.Wait(A | B) -} -`, - }, -} |