internal/impl: rename encode->codec in various places

The code organization is simpler if we keep the functions encoding and
decoding a particular type (e.g., maps) together rather than split
across files. Rename various "encode" files to "codec" in preparation
for adding fast-path decoding.

Change-Id: If1e271da99d31533ffefc19b1fc847936fa9484a
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/185241
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
Damien Neil 2019-07-08 12:46:01 -07:00
parent 8b0b71e9b6
commit edf7bdda31
9 changed files with 4 additions and 4 deletions

View File

@ -8,11 +8,11 @@ import (
"text/template"
)
func generateImplEncode() string {
return mustExecute(implEncodeTemplate, ProtoKinds)
func generateImplCodec() string {
return mustExecute(implCodecTemplate, ProtoKinds)
}
var implEncodeTemplate = template.Must(template.New("").Parse(`
var implCodecTemplate = template.Must(template.New("").Parse(`
{{- /*
IsZero is an expression testing if 'v' is the zero value.
*/ -}}

View File

@ -38,7 +38,7 @@ func main() {
chdirRoot()
writeSource("internal/filedesc/desc_list_gen.go", generateDescListTypes())
writeSource("internal/impl/encode_gen.go", generateImplEncode())
writeSource("internal/impl/codec_gen.go", generateImplCodec())
writeSource("proto/decode_gen.go", generateProtoDecode())
writeSource("proto/encode_gen.go", generateProtoEncode())
writeSource("proto/size_gen.go", generateProtoSize())