1
// Copyright 2011 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
20
`Adapt code to types moved from os/signal to signal.
22
http://codereview.appspot.com/4437091
26
func signal(f *ast.File) (fixed bool) {
27
if !imports(f, "os/signal") {
31
walk(f, func(n interface{}) {
32
s, ok := n.(*ast.SelectorExpr)
34
if !ok || !isTopName(s.X, "signal") {
39
if sel == "Signal" || sel == "UnixSignal" || strings.HasPrefix(sel, "SIG") {
41
s.X = &ast.Ident{Name: "os"}
46
if fixed && !usesImport(f, "os/signal") {
47
deleteImport(f, "os/signal")