protoc-gen-go: move package comments to before the package decl (#715)

We intentionally don't attach comments from the .proto source file to
the Go package declaration (since this produces strange output when
multiple .proto files in the same Go package all have comments), but
putting the comment above the package decl makes it easier to find and
keeps it from being obscured by the imports.

Also change the package comment to be generated with PrintComments
(producing // comments rather than /* */ comments) to save a few lines
of code and be internally consistent.
diff --git a/protoc-gen-go/generator/generator.go b/protoc-gen-go/generator/generator.go
index 8b1759c..eb880ab 100644
--- a/protoc-gen-go/generator/generator.go
+++ b/protoc-gen-go/generator/generator.go
@@ -1211,23 +1211,10 @@
 		g.P("// source: ", g.file.Name)
 	}
 	g.P()
-
+	g.PrintComments(strconv.Itoa(packagePath))
+	g.P()
 	g.P("package ", g.file.packageName)
 	g.P()
-
-	if loc, ok := g.file.comments[strconv.Itoa(packagePath)]; ok {
-		g.P("/*")
-		// not using g.PrintComments because this is a /* */ comment block.
-		text := strings.TrimSuffix(loc.GetLeadingComments(), "\n")
-		for _, line := range strings.Split(text, "\n") {
-			line = strings.TrimPrefix(line, " ")
-			// ensure we don't escape from the block comment
-			line = strings.Replace(line, "*/", "* /", -1)
-			g.P(line)
-		}
-		g.P("*/")
-		g.P()
-	}
 }
 
 // deprecationComment is the standard comment added to deprecated
diff --git a/protoc-gen-go/testdata/deprecated/deprecated.pb.go b/protoc-gen-go/testdata/deprecated/deprecated.pb.go
index 8ad6676..bce051d 100644
--- a/protoc-gen-go/testdata/deprecated/deprecated.pb.go
+++ b/protoc-gen-go/testdata/deprecated/deprecated.pb.go
@@ -1,11 +1,9 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // deprecated/deprecated.proto is a deprecated file.
 
-package deprecated
+// package deprecated contains only deprecated messages and services.
 
-/*
-package deprecated contains only deprecated messages and services.
-*/
+package deprecated
 
 import (
 	fmt "fmt"
diff --git a/protoc-gen-go/testdata/my_test/test.pb.go b/protoc-gen-go/testdata/my_test/test.pb.go
index 0321501..54e65bd 100644
--- a/protoc-gen-go/testdata/my_test/test.pb.go
+++ b/protoc-gen-go/testdata/my_test/test.pb.go
@@ -1,11 +1,9 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // source: my_test/test.proto
 
-package test
+// This package holds interesting messages.
 
-/*
-This package holds interesting messages.
-*/
+package test
 
 import (
 	fmt "fmt"