mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 16:02:26 -05:00 
			
		
		
		
	[chore]: Bump github.com/prometheus/client_golang from 1.17.0 to 1.18.0 (#2507)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.17.0...v1.18.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
		
					parent
					
						
							
								10660e566d
							
						
					
				
			
			
				commit
				
					
						d9127f5630
					
				
			
		
					 23 changed files with 235 additions and 58 deletions
				
			
		|  | @ -19,9 +19,10 @@ import ( | |||
| 	"errors" | ||||
| 	"io" | ||||
| 
 | ||||
| 	"github.com/golang/protobuf/proto" | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
| 
 | ||||
| // TODO: Give error package name prefix in next minor release. | ||||
| var errInvalidVarint = errors.New("invalid varint32 encountered") | ||||
| 
 | ||||
| // ReadDelimited decodes a message from the provided length-delimited stream, | ||||
|  | @ -36,6 +37,12 @@ var errInvalidVarint = errors.New("invalid varint32 encountered") | |||
| // of the stream has been reached in doing so.  In that case, any subsequent | ||||
| // calls return (0, io.EOF). | ||||
| func ReadDelimited(r io.Reader, m proto.Message) (n int, err error) { | ||||
| 	// TODO: Consider allowing the caller to specify a decode buffer in the | ||||
| 	// next major version. | ||||
| 
 | ||||
| 	// TODO: Consider using error wrapping to annotate error state in pass- | ||||
| 	// through cases in the next minor version. | ||||
| 
 | ||||
| 	// Per AbstractParser#parsePartialDelimitedFrom with | ||||
| 	// CodedInputStream#readRawVarint32. | ||||
| 	var headerBuf [binary.MaxVarintLen32]byte | ||||
|  | @ -53,15 +60,14 @@ func ReadDelimited(r io.Reader, m proto.Message) (n int, err error) { | |||
| 			if err != nil { | ||||
| 				return bytesRead, err | ||||
| 			} | ||||
| 			// A Reader should not return (0, nil), but if it does, | ||||
| 			// it should be treated as no-op (according to the | ||||
| 			// Reader contract). So let's go on... | ||||
| 			// A Reader should not return (0, nil); but if it does, it should | ||||
| 			// be treated as no-op according to the Reader contract. | ||||
| 			continue | ||||
| 		} | ||||
| 		bytesRead += newBytesRead | ||||
| 		// Now present everything read so far to the varint decoder and | ||||
| 		// see if a varint can be decoded already. | ||||
| 		messageLength, varIntBytes = proto.DecodeVarint(headerBuf[:bytesRead]) | ||||
| 		messageLength, varIntBytes = binary.Uvarint(headerBuf[:bytesRead]) | ||||
| 	} | ||||
| 
 | ||||
| 	messageBuf := make([]byte, messageLength) | ||||
|  | @ -18,7 +18,7 @@ import ( | |||
| 	"encoding/binary" | ||||
| 	"io" | ||||
| 
 | ||||
| 	"github.com/golang/protobuf/proto" | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
| 
 | ||||
| // WriteDelimited encodes and dumps a message to the provided writer prefixed | ||||
|  | @ -28,6 +28,9 @@ import ( | |||
| // number of bytes written and any applicable error.  This is roughly | ||||
| // equivalent to the companion Java API's MessageLite#writeDelimitedTo. | ||||
| func WriteDelimited(w io.Writer, m proto.Message) (n int, err error) { | ||||
| 	// TODO: Consider allowing the caller to specify an encode buffer in the | ||||
| 	// next major version. | ||||
| 
 | ||||
| 	buffer, err := proto.Marshal(m) | ||||
| 	if err != nil { | ||||
| 		return 0, err | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue