diff options
| author | 2022-09-28 18:30:40 +0100 | |
|---|---|---|
| committer | 2022-09-28 18:30:40 +0100 | |
| commit | a156188b3eb5cb3da44aa1b7452265f5fa38a607 (patch) | |
| tree | 7097fa48d56fbabc7c2c8750b1f3bc9321d71c0f /vendor/google.golang.org/protobuf/internal/encoding/text | |
| parent | [bugfix] Fix emphasis being added to emoji shortcodes with markdown parsing (... (diff) | |
| download | gotosocial-a156188b3eb5cb3da44aa1b7452265f5fa38a607.tar.xz | |
[chore] update dependencies, bump to Go 1.19.1 (#826)
* update dependencies, bump Go version to 1.19
* bump test image Go version
* update golangci-lint
* update gotosocial-drone-build
* sign
* linting, go fmt
* update swagger docs
* update swagger docs
* whitespace
* update contributing.md
* fuckin whoopsie doopsie
* linterino, linteroni
* fix followrequest test not starting processor
* fix other api/client tests not starting processor
* fix remaining tests where processor not started
* bump go-runners version
* don't check last-webfingered-at, processor may have updated this
* update swagger command
* update bun to latest version
* fix embed to work the same as before with new bun
Signed-off-by: kim <grufwub@gmail.com>
Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
Diffstat (limited to 'vendor/google.golang.org/protobuf/internal/encoding/text')
3 files changed, 31 insertions, 9 deletions
| diff --git a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go index 37803773f..427c62d03 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go @@ -8,7 +8,6 @@ import (  	"bytes"  	"fmt"  	"io" -	"regexp"  	"strconv"  	"unicode/utf8" @@ -421,7 +420,7 @@ func (d *Decoder) parseFieldName() (tok Token, err error) {  		return Token{}, d.newSyntaxError("invalid field number: %s", d.in[:num.size])  	} -	return Token{}, d.newSyntaxError("invalid field name: %s", errRegexp.Find(d.in)) +	return Token{}, d.newSyntaxError("invalid field name: %s", errId(d.in))  }  // parseTypeName parses Any type URL or extension field name. The name is @@ -571,7 +570,7 @@ func (d *Decoder) parseScalar() (Token, error) {  		return tok, nil  	} -	return Token{}, d.newSyntaxError("invalid scalar value: %s", errRegexp.Find(d.in)) +	return Token{}, d.newSyntaxError("invalid scalar value: %s", errId(d.in))  }  // parseLiteralValue parses a literal value. A literal value is used for @@ -653,8 +652,29 @@ func consume(b []byte, n int) []byte {  	return b  } -// Any sequence that looks like a non-delimiter (for error reporting). -var errRegexp = regexp.MustCompile(`^([-+._a-zA-Z0-9\/]+|.)`) +// errId extracts a byte sequence that looks like an invalid ID +// (for the purposes of error reporting). +func errId(seq []byte) []byte { +	const maxLen = 32 +	for i := 0; i < len(seq); { +		if i > maxLen { +			return append(seq[:i:i], "…"...) +		} +		r, size := utf8.DecodeRune(seq[i:]) +		if r > utf8.RuneSelf || (r != '/' && isDelim(byte(r))) { +			if i == 0 { +				// Either the first byte is invalid UTF-8 or a +				// delimiter, or the first rune is non-ASCII. +				// Return it as-is. +				i = size +			} +			return seq[:i:i] +		} +		i += size +	} +	// No delimiter found. +	return seq +}  // isDelim returns true if given byte is a delimiter character.  func isDelim(c byte) bool { diff --git a/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go b/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go index f2d90b789..81a5d8c86 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go @@ -50,8 +50,10 @@ type number struct {  // parseNumber constructs a number object from given input. It allows for the  // following patterns: -//   integer: ^-?([1-9][0-9]*|0[xX][0-9a-fA-F]+|0[0-7]*) -//   float: ^-?((0|[1-9][0-9]*)?([.][0-9]*)?([eE][+-]?[0-9]+)?[fF]?) +// +//	integer: ^-?([1-9][0-9]*|0[xX][0-9a-fA-F]+|0[0-7]*) +//	float: ^-?((0|[1-9][0-9]*)?([.][0-9]*)?([eE][+-]?[0-9]+)?[fF]?) +//  // It also returns the number of parsed bytes for the given number, 0 if it is  // not a number.  func parseNumber(input []byte) number { diff --git a/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go b/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go index 0ce8d6fb8..7ae6c2a3c 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go @@ -24,6 +24,6 @@  // the Go implementation should as well.  //  // The text format is almost a superset of JSON except: -//	* message keys are not quoted strings, but identifiers -//	* the top-level value must be a message without the delimiters +//   - message keys are not quoted strings, but identifiers +//   - the top-level value must be a message without the delimiters  package text | 
