]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/fix: remove os.Wait gofix.
authorDavid Symonds <dsymonds@golang.org>
Wed, 22 Feb 2012 04:46:31 +0000 (15:46 +1100)
committerDavid Symonds <dsymonds@golang.org>
Wed, 22 Feb 2012 04:46:31 +0000 (15:46 +1100)
The os.Wait function has been removed entirely, so there's no point in fixing code that called it.

R=r
CC=golang-dev
https://golang.org/cl/5685078

doc/go1.html
doc/go1.tmpl
src/cmd/fix/oswait.go [deleted file]
src/cmd/fix/oswait_test.go [deleted file]

index 38cd0e94f238749ed929c16187d993a5d77d1d36..4bc4f66289421940e43ea751f6d8e95fb7104538 100644 (file)
@@ -1465,9 +1465,7 @@ the <code>Process</code> type persists.
 
 <p>
 <em>Updating</em>:
-Gofix will rewrite calls to <code>os.Wait</code> with an explicit zero
-argument, dropping the argument.
-All other changes will be caught by the compiler and must be updated by hand.
+All changes will be caught by the compiler and must be updated by hand.
 </p>
 
 <h4 id="os_fileinfo">The os.FileInfo type</h4>
index f61dcd5cce7cc2bb4d8ef8ac046fa51a1fce99f1..2f0b32607e536ae1813877c38ccd2c5eb0e52f8f 100644 (file)
@@ -1368,9 +1368,7 @@ the <code>Process</code> type persists.
 
 <p>
 <em>Updating</em>:
-Gofix will rewrite calls to <code>os.Wait</code> with an explicit zero
-argument, dropping the argument.
-All other changes will be caught by the compiler and must be updated by hand.
+All changes will be caught by the compiler and must be updated by hand.
 </p>
 
 <h4 id="os_fileinfo">The os.FileInfo type</h4>
diff --git a/src/cmd/fix/oswait.go b/src/cmd/fix/oswait.go
deleted file mode 100644 (file)
index fdc23f8..0000000
+++ /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 (file)
index baff017..0000000
+++ /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)
-}
-`,
-       },
-}