"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/github.com/golang/protobuf/proto/properties.go" between
gitea-1.9.3.tar.gz and gitea-1.9.4.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

properties.go  (gitea-1.9.3):properties.go  (gitea-1.9.4)
skipping to change at line 41 skipping to change at line 41
package proto package proto
/* /*
* Routines for encoding data into the wire format for protocol buffers. * Routines for encoding data into the wire format for protocol buffers.
*/ */
import ( import (
"fmt" "fmt"
"log" "log"
"os"
"reflect" "reflect"
"sort" "sort"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
) )
const debug bool = false const debug bool = false
// Constants that identify the encoding of a value on the wire. // Constants that identify the encoding of a value on the wire.
skipping to change at line 197 skipping to change at line 196
s += ",def=" + p.Default s += ",def=" + p.Default
} }
return s return s
} }
// Parse populates p by parsing a string in the protobuf struct field tag style. // Parse populates p by parsing a string in the protobuf struct field tag style.
func (p *Properties) Parse(s string) { func (p *Properties) Parse(s string) {
// "bytes,49,opt,name=foo,def=hello!" // "bytes,49,opt,name=foo,def=hello!"
fields := strings.Split(s, ",") // breaks def=, but handled below. fields := strings.Split(s, ",") // breaks def=, but handled below.
if len(fields) < 2 { if len(fields) < 2 {
fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s) log.Printf("proto: tag has too few fields: %q", s)
return return
} }
p.Wire = fields[0] p.Wire = fields[0]
switch p.Wire { switch p.Wire {
case "varint": case "varint":
p.WireType = WireVarint p.WireType = WireVarint
case "fixed32": case "fixed32":
p.WireType = WireFixed32 p.WireType = WireFixed32
case "fixed64": case "fixed64":
p.WireType = WireFixed64 p.WireType = WireFixed64
case "zigzag32": case "zigzag32":
p.WireType = WireVarint p.WireType = WireVarint
case "zigzag64": case "zigzag64":
p.WireType = WireVarint p.WireType = WireVarint
case "bytes", "group": case "bytes", "group":
p.WireType = WireBytes p.WireType = WireBytes
// no numeric converter for non-numeric types // no numeric converter for non-numeric types
default: default:
fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s) log.Printf("proto: tag has unknown wire type: %q", s)
return return
} }
var err error var err error
p.Tag, err = strconv.Atoi(fields[1]) p.Tag, err = strconv.Atoi(fields[1])
if err != nil { if err != nil {
return return
} }
outer: outer:
 End of changes. 3 change blocks. 
3 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)