mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-02 17:13:15 -06:00
[chore]: Bump github.com/uptrace/bun from 1.2.1 to 1.2.5
Bumps [github.com/uptrace/bun](https://github.com/uptrace/bun) from 1.2.1 to 1.2.5. - [Release notes](https://github.com/uptrace/bun/releases) - [Changelog](https://github.com/uptrace/bun/blob/master/CHANGELOG.md) - [Commits](https://github.com/uptrace/bun/compare/v1.2.1...v1.2.5) --- updated-dependencies: - dependency-name: github.com/uptrace/bun dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
51cb6cae16
commit
2470c8d8a0
43 changed files with 3161 additions and 245 deletions
50
vendor/github.com/uptrace/bun/internal/parser/parser.go
generated
vendored
50
vendor/github.com/uptrace/bun/internal/parser/parser.go
generated
vendored
|
|
@ -2,6 +2,8 @@ package parser
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
|
||||
"github.com/uptrace/bun/internal"
|
||||
|
|
@ -22,23 +24,43 @@ func NewString(s string) *Parser {
|
|||
return New(internal.Bytes(s))
|
||||
}
|
||||
|
||||
func (p *Parser) Reset(b []byte) {
|
||||
p.b = b
|
||||
p.i = 0
|
||||
}
|
||||
|
||||
func (p *Parser) Valid() bool {
|
||||
return p.i < len(p.b)
|
||||
}
|
||||
|
||||
func (p *Parser) Bytes() []byte {
|
||||
func (p *Parser) Remaining() []byte {
|
||||
return p.b[p.i:]
|
||||
}
|
||||
|
||||
func (p *Parser) ReadByte() (byte, error) {
|
||||
if p.Valid() {
|
||||
ch := p.b[p.i]
|
||||
p.Advance()
|
||||
return ch, nil
|
||||
}
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
func (p *Parser) Read() byte {
|
||||
if p.Valid() {
|
||||
c := p.b[p.i]
|
||||
ch := p.b[p.i]
|
||||
p.Advance()
|
||||
return c
|
||||
return ch
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (p *Parser) Unread() {
|
||||
if p.i > 0 {
|
||||
p.i--
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Parser) Peek() byte {
|
||||
if p.Valid() {
|
||||
return p.b[p.i]
|
||||
|
|
@ -50,19 +72,25 @@ func (p *Parser) Advance() {
|
|||
p.i++
|
||||
}
|
||||
|
||||
func (p *Parser) Skip(skip byte) bool {
|
||||
if p.Peek() == skip {
|
||||
func (p *Parser) Skip(skip byte) error {
|
||||
ch := p.Peek()
|
||||
if ch == skip {
|
||||
p.Advance()
|
||||
return true
|
||||
return nil
|
||||
}
|
||||
return false
|
||||
return fmt.Errorf("got %q, wanted %q", ch, skip)
|
||||
}
|
||||
|
||||
func (p *Parser) SkipBytes(skip []byte) bool {
|
||||
if len(skip) > len(p.b[p.i:]) {
|
||||
return false
|
||||
func (p *Parser) SkipPrefix(skip []byte) error {
|
||||
if !bytes.HasPrefix(p.b[p.i:], skip) {
|
||||
return fmt.Errorf("got %q, wanted prefix %q", p.b, skip)
|
||||
}
|
||||
if !bytes.Equal(p.b[p.i:p.i+len(skip)], skip) {
|
||||
p.i += len(skip)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Parser) CutPrefix(skip []byte) bool {
|
||||
if !bytes.HasPrefix(p.b[p.i:], skip) {
|
||||
return false
|
||||
}
|
||||
p.i += len(skip)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue