summaryrefslogtreecommitdiff
path: root/src/cmd/fix/go1rename.go
blob: 2995880c300667f97f9f9d53e434a538c2afa189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright 2012 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() {
	register(go1renameFix)
}

var go1renameFix = fix{
	"go1rename",
	"2012-02-12",
	renameFix(go1renameReplace),
	`Rewrite package-level names that have been renamed in Go 1.

http://codereview.appspot.com/5625045/
http://codereview.appspot.com/5672072/
`,
}

var go1renameReplace = []rename{
	{
		OldImport: "crypto/aes",
		NewImport: "crypto/cipher",
		Old:       "*aes.Cipher",
		New:       "cipher.Block",
	},
	{
		OldImport: "crypto/des",
		NewImport: "crypto/cipher",
		Old:       "*des.Cipher",
		New:       "cipher.Block",
	},
	{
		OldImport: "crypto/des",
		NewImport: "crypto/cipher",
		Old:       "*des.TripleDESCipher",
		New:       "cipher.Block",
	},
	{
		OldImport: "net/url",
		NewImport: "",
		Old:       "url.ParseWithReference",
		New:       "url.Parse",
	},
	{
		OldImport: "net/url",
		NewImport: "",
		Old:       "url.ParseRequest",
		New:       "url.ParseRequestURI",
	},
	{
		OldImport: "os",
		NewImport: "syscall",
		Old:       "os.Exec",
		New:       "syscall.Exec",
	},
	{
		OldImport: "runtime",
		NewImport: "",
		Old:       "runtime.Cgocalls",
		New:       "runtime.NumCgoCall",
	},
	{
		OldImport: "runtime",
		NewImport: "",
		Old:       "runtime.Goroutines",
		New:       "runtime.NumGoroutine",
	},
}