1- // This package is the tool msgp uses to generate Go code for the types in your program that you
2- // want to serialize to and from the MessagePack format. The package is designed to be usable by
1+ // Package gen is the tool msgp uses to generate Go code for the types in your program that you
2+ // want to serialize to and from the MessagePack format. This package is designed to be usable by
33// both the main.go file at the root of this repository (installed as a command line tool that is
44// called by the `go generate` command) and by external programs that import the package.
55//
1111//
1212// import "github.com/dchenk/msgp/gen"
1313//
14- // err := gen.Run("path/to/myfile .go", gen.Size|gen.Marshal|gen.Unmarshal|gen.Test, false)
14+ // err := gen.Run("path/to/my_file .go", gen.Size|gen.Marshal|gen.Unmarshal|gen.Test, false)
1515//
1616package gen
1717
@@ -90,7 +90,7 @@ func RunData(srcPath string, mode Method, unexported bool) (mainBuf *bytes.Buffe
9090 }
9191
9292 fmt .Println (chalk .Magenta .Color ("======= MessagePack Code Generating =======" ))
93- fmt .Printf (chalk .Magenta .Color (">>> Input: %q \n " ), srcPath )
93+ fmt .Printf (chalk .Magenta .Color (" Input: %s \n " ), srcPath )
9494
9595 mainBuf = bytes .NewBuffer (make ([]byte , 0 , 4096 ))
9696 writePkgHeader (mainBuf , s .pkg )
@@ -101,7 +101,7 @@ func RunData(srcPath string, mode Method, unexported bool) (mainBuf *bytes.Buffe
101101 // If the import has an alias, include it (imp.Path.Value is a quoted string).
102102 // But do not include the import if its alias is the blank identifier.
103103 if imp .Name .Name == "_" {
104- fmt .Printf (chalk .Blue .Color ("Not including import %s with blank identifier as alias\n " ), imp .Path .Value )
104+ fmt .Printf (chalk .Blue .Color ("Not including import %s with blank identifier as alias. \n " ), imp .Path .Value )
105105 } else {
106106 mainImports = append (mainImports , imp .Name .Name + " " + imp .Path .Value )
107107 }
@@ -123,7 +123,7 @@ func RunData(srcPath string, mode Method, unexported bool) (mainBuf *bytes.Buffe
123123
124124 writeImportHeader (mainBuf , mainImports )
125125
126- // Write the test file if it's needed .
126+ // Write the test file if it's desired .
127127 if mode & Test == Test {
128128 testsBuf = bytes .NewBuffer (make ([]byte , 0 , 4096 ))
129129 writePkgHeader (testsBuf , s .pkg )
@@ -147,7 +147,7 @@ func formatWrite(fileName string, data []byte) error {
147147 if err != nil {
148148 return err
149149 }
150- fmt .Printf (chalk .Magenta .Color (">>> Writing file \" %s \" \n " ), fileName )
150+ fmt .Printf (chalk .Magenta .Color (" Writing file: %s \n " ), fileName )
151151 return ioutil .WriteFile (fileName , out , 0600 )
152152}
153153
0 commit comments