mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 07:12:26 -05:00 
			
		
		
		
	[chore] Update a bunch of database dependencies (#1772)
* [chore] Update a bunch of database dependencies * fix lil thing
This commit is contained in:
		
					parent
					
						
							
								66df974143
							
						
					
				
			
			
				commit
				
					
						ec325fee14
					
				
			
		
					 402 changed files with 35068 additions and 35401 deletions
				
			
		
							
								
								
									
										2
									
								
								vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -294,7 +294,7 @@ func (d *Decoder) isValueNext() bool { | |||
| } | ||||
| 
 | ||||
| // consumeToken constructs a Token for given Kind with raw value derived from | ||||
| // current d.in and given size, and consumes the given size-lenght of it. | ||||
| // current d.in and given size, and consumes the given size-length of it. | ||||
| func (d *Decoder) consumeToken(kind Kind, size int) Token { | ||||
| 	tok := Token{ | ||||
| 		kind: kind, | ||||
|  |  | |||
							
								
								
									
										5
									
								
								vendor/google.golang.org/protobuf/internal/encoding/text/decode.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								vendor/google.golang.org/protobuf/internal/encoding/text/decode.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -412,12 +412,13 @@ func (d *Decoder) parseFieldName() (tok Token, err error) { | |||
| 	// Field number. Identify if input is a valid number that is not negative | ||||
| 	// and is decimal integer within 32-bit range. | ||||
| 	if num := parseNumber(d.in); num.size > 0 { | ||||
| 		str := num.string(d.in) | ||||
| 		if !num.neg && num.kind == numDec { | ||||
| 			if _, err := strconv.ParseInt(string(d.in[:num.size]), 10, 32); err == nil { | ||||
| 			if _, err := strconv.ParseInt(str, 10, 32); err == nil { | ||||
| 				return d.consumeToken(Name, num.size, uint8(FieldNumber)), nil | ||||
| 			} | ||||
| 		} | ||||
| 		return Token{}, d.newSyntaxError("invalid field number: %s", d.in[:num.size]) | ||||
| 		return Token{}, d.newSyntaxError("invalid field number: %s", str) | ||||
| 	} | ||||
| 
 | ||||
| 	return Token{}, d.newSyntaxError("invalid field name: %s", errId(d.in)) | ||||
|  |  | |||
							
								
								
									
										43
									
								
								vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										43
									
								
								vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -15,17 +15,12 @@ func (d *Decoder) parseNumberValue() (Token, bool) { | |||
| 	if num.neg { | ||||
| 		numAttrs |= isNegative | ||||
| 	} | ||||
| 	strSize := num.size | ||||
| 	last := num.size - 1 | ||||
| 	if num.kind == numFloat && (d.in[last] == 'f' || d.in[last] == 'F') { | ||||
| 		strSize = last | ||||
| 	} | ||||
| 	tok := Token{ | ||||
| 		kind:     Scalar, | ||||
| 		attrs:    numberValue, | ||||
| 		pos:      len(d.orig) - len(d.in), | ||||
| 		raw:      d.in[:num.size], | ||||
| 		str:      string(d.in[:strSize]), | ||||
| 		str:      num.string(d.in), | ||||
| 		numAttrs: numAttrs, | ||||
| 	} | ||||
| 	d.consume(num.size) | ||||
|  | @ -46,6 +41,27 @@ type number struct { | |||
| 	kind uint8 | ||||
| 	neg  bool | ||||
| 	size int | ||||
| 	// if neg, this is the length of whitespace and comments between | ||||
| 	// the minus sign and the rest fo the number literal | ||||
| 	sep int | ||||
| } | ||||
| 
 | ||||
| func (num number) string(data []byte) string { | ||||
| 	strSize := num.size | ||||
| 	last := num.size - 1 | ||||
| 	if num.kind == numFloat && (data[last] == 'f' || data[last] == 'F') { | ||||
| 		strSize = last | ||||
| 	} | ||||
| 	if num.neg && num.sep > 0 { | ||||
| 		// strip whitespace/comments between negative sign and the rest | ||||
| 		strLen := strSize - num.sep | ||||
| 		str := make([]byte, strLen) | ||||
| 		str[0] = data[0] | ||||
| 		copy(str[1:], data[num.sep+1:strSize]) | ||||
| 		return string(str) | ||||
| 	} | ||||
| 	return string(data[:strSize]) | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| // parseNumber constructs a number object from given input. It allows for the | ||||
|  | @ -67,19 +83,22 @@ func parseNumber(input []byte) number { | |||
| 	} | ||||
| 
 | ||||
| 	// Optional - | ||||
| 	var sep int | ||||
| 	if s[0] == '-' { | ||||
| 		neg = true | ||||
| 		s = s[1:] | ||||
| 		size++ | ||||
| 		// Consume any whitespace or comments between the | ||||
| 		// negative sign and the rest of the number | ||||
| 		lenBefore := len(s) | ||||
| 		s = consume(s, 0) | ||||
| 		sep = lenBefore - len(s) | ||||
| 		size += sep | ||||
| 		if len(s) == 0 { | ||||
| 			return number{} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	// C++ allows for whitespace and comments in between the negative sign and | ||||
| 	// the rest of the number. This logic currently does not but is consistent | ||||
| 	// with v1. | ||||
| 
 | ||||
| 	switch { | ||||
| 	case s[0] == '0': | ||||
| 		if len(s) > 1 { | ||||
|  | @ -116,7 +135,7 @@ func parseNumber(input []byte) number { | |||
| 				if len(s) > 0 && !isDelim(s[0]) { | ||||
| 					return number{} | ||||
| 				} | ||||
| 				return number{kind: kind, neg: neg, size: size} | ||||
| 				return number{kind: kind, neg: neg, size: size, sep: sep} | ||||
| 			} | ||||
| 		} | ||||
| 		s = s[1:] | ||||
|  | @ -188,5 +207,5 @@ func parseNumber(input []byte) number { | |||
| 		return number{} | ||||
| 	} | ||||
| 
 | ||||
| 	return number{kind: kind, neg: neg, size: size} | ||||
| 	return number{kind: kind, neg: neg, size: size, sep: sep} | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue