Преглед изворни кода

goprotobuf: update to go 1 import strings

R=dsymonds
CC=golang-dev
http://codereview.appspot.com/5496065
Rob Pike пре 14 година
родитељ
комит
3f6f2d845d

+ 1 - 1
compiler/descriptor/Makefile

@@ -31,7 +31,7 @@
 
 include $(GOROOT)/src/Make.inc
 
-TARG=goprotobuf.googlecode.com/hg/compiler/descriptor
+TARG=code.google.com/p/goprotobuf/compiler/descriptor
 GOFILES=\
 	descriptor.pb.go\
 

+ 1 - 2
compiler/descriptor/descriptor.pb.go

@@ -3,14 +3,13 @@
 
 package google_protobuf
 
-import proto "goprotobuf.googlecode.com/hg/proto"
+import proto "code.google.com/p/goprotobuf/proto"
 import "math"
 
 // Reference proto, math & os imports to suppress error if they are not otherwise used.
 var _ = proto.GetString
 var _ = math.Inf
 
-
 type FieldDescriptorProto_Type int32
 
 const (

+ 1 - 1
compiler/generator/Makefile

@@ -31,7 +31,7 @@
 
 include $(GOROOT)/src/Make.inc
 
-TARG=goprotobuf.googlecode.com/hg/compiler/generator
+TARG=code.google.com/p/goprotobuf/compiler/generator
 GOFILES=\
 	generator.go\
 

+ 5 - 4
compiler/generator/generator.go

@@ -48,9 +48,9 @@ import (
 	"strconv"
 	"strings"
 
-	descriptor "goprotobuf.googlecode.com/hg/compiler/descriptor"
-	plugin "goprotobuf.googlecode.com/hg/compiler/plugin"
-	"goprotobuf.googlecode.com/hg/proto"
+	descriptor "code.google.com/p/goprotobuf/compiler/descriptor"
+	plugin "code.google.com/p/goprotobuf/compiler/plugin"
+	"code.google.com/p/goprotobuf/proto"
 )
 
 // A Plugin provides functionality to add to the output during Go code generation,
@@ -403,6 +403,7 @@ func (g *Generator) DefaultPackageName(obj Object) string {
 
 // For each input file, the unique package name to use, underscored.
 var uniquePackageName = make(map[*descriptor.FileDescriptorProto]string)
+
 // Package names already registered.  Key is the name from the .proto file;
 // value is the name that appears in the generated code.
 var pkgNamesInUse = make(map[string]bool)
@@ -814,7 +815,7 @@ func (g *Generator) generateImports() {
 	// do, which is tricky when there's a plugin, just import it and
 	// reference it later. The same argument applies to the math package,
 	// for handling bit patterns for floating-point numbers.
-	g.P("import " + g.ProtoPkg + " " + Quote(g.ImportPrefix+"goprotobuf.googlecode.com/hg/proto"))
+	g.P("import " + g.ProtoPkg + " " + Quote(g.ImportPrefix+"code.google.com/p/goprotobuf/proto"))
 	g.P(`import "math"`)
 	for _, s := range g.file.Dependency {
 		fd := g.fileByName(s)

+ 2 - 2
compiler/main.go

@@ -43,8 +43,8 @@ import (
 	"io/ioutil"
 	"os"
 
-	"goprotobuf.googlecode.com/hg/proto"
-	"goprotobuf.googlecode.com/hg/compiler/generator"
+	"code.google.com/p/goprotobuf/compiler/generator"
+	"code.google.com/p/goprotobuf/proto"
 )
 
 func main() {

+ 2 - 2
compiler/plugin/Makefile

@@ -31,7 +31,7 @@
 
 include $(GOROOT)/src/Make.inc
 
-TARG=goprotobuf.googlecode.com/hg/compiler/plugin
+TARG=code.google.com/p/goprotobuf/compiler/plugin
 GOFILES=\
 	plugin.pb.go\
 
@@ -47,7 +47,7 @@ regenerate:
 	cd $(HOME)/protobuf-2.3.0/src && \
 	protoc --go_out=. ./google/protobuf/compiler/plugin.proto && \
 	cat ./google/protobuf/compiler/plugin.pb.go | \
-		sed '/^import/s;google/protobuf/descriptor.pb;goprotobuf.googlecode.com/hg/compiler/descriptor;' >$(GOROOT)/src/pkg/goprotobuf.googlecode.com/hg/compiler/plugin/plugin.pb.go
+		sed '/^import/s;google/protobuf/descriptor.pb;code.google.com/p/goprotobuf/compiler/descriptor;' >$(GOROOT)/src/pkg/code.google.com/p/goprotobuf/compiler/plugin/plugin.pb.go
 
 restore:
 	cp plugin.pb.golden plugin.pb.go

+ 2 - 2
compiler/plugin/plugin.pb.go

@@ -3,10 +3,10 @@
 
 package google_protobuf_compiler
 
-import proto "goprotobuf.googlecode.com/hg/proto"
+import proto "code.google.com/p/goprotobuf/proto"
 import "math"
 
-import google_protobuf "goprotobuf.googlecode.com/hg/compiler/descriptor"
+import google_protobuf "code.google.com/p/goprotobuf/compiler/descriptor"
 
 // Reference proto, math & os imports to suppress error if they are not otherwise used.
 var _ = proto.GetString

+ 1 - 1
compiler/testdata/extension_test.go

@@ -38,7 +38,7 @@ import (
 	"regexp"
 	"testing"
 
-	"goprotobuf.googlecode.com/hg/proto"
+	"code.google.com/p/goprotobuf/proto"
 	base "extension_base.pb"
 	user "extension_user.pb"
 )

+ 1 - 1
proto/Makefile

@@ -32,7 +32,7 @@
 
 include $(GOROOT)/src/Make.inc
 
-TARG=goprotobuf.googlecode.com/hg/proto
+TARG=code.google.com/p/goprotobuf/proto
 GOFILES=\
 	clone.go\
 	decode.go\

+ 1 - 2
proto/all_test.go

@@ -29,7 +29,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
 package proto_test
 
 import (
@@ -42,7 +41,7 @@ import (
 	"testing"
 
 	. "./testdata/_obj/test_proto"
-	. "goprotobuf.googlecode.com/hg/proto"
+	. "code.google.com/p/goprotobuf/proto"
 )
 
 var globalO *Buffer

+ 1 - 1
proto/clone_test.go

@@ -35,7 +35,7 @@ import (
 	"log"
 	"testing"
 
-	"goprotobuf.googlecode.com/hg/proto"
+	"code.google.com/p/goprotobuf/proto"
 
 	pb "./testdata/_obj/test_proto"
 )

+ 1 - 1
proto/equal_test.go

@@ -35,8 +35,8 @@ import (
 	"log"
 	"testing"
 
-	. "goprotobuf.googlecode.com/hg/proto"
 	pb "./testdata/_obj/test_proto"
+	. "code.google.com/p/goprotobuf/proto"
 )
 
 // Four identical base messages.

+ 2 - 2
proto/lib.go

@@ -83,7 +83,7 @@
 
 		package example
 
-		import "goprotobuf.googlecode.com/hg/proto"
+		import "code.google.com/p/goprotobuf/proto"
 
 		type FOO int32
 		const (
@@ -134,7 +134,7 @@
 		import (
 			"log"
 
-			"goprotobuf.googlecode.com/hg/proto"
+			"code.google.com/p/goprotobuf/proto"
 			"./example.pb"
 		)
 

+ 1 - 1
proto/text_parser_test.go

@@ -33,7 +33,7 @@ package proto_test
 
 import (
 	. "./testdata/_obj/test_proto"
-	. "goprotobuf.googlecode.com/hg/proto"
+	. "code.google.com/p/goprotobuf/proto"
 	"reflect"
 	"testing"
 )

+ 1 - 1
proto/text_test.go

@@ -36,7 +36,7 @@ import (
 	"strings"
 	"testing"
 
-	"goprotobuf.googlecode.com/hg/proto"
+	"code.google.com/p/goprotobuf/proto"
 
 	pb "./testdata/_obj/test_proto"
 )