1
0
Fork 0
forked from forgejo/forgejo

Revert "Add Debian package registry" (#24412)

Reverts go-gitea/gitea#22854
This commit is contained in:
Yarden Shoham 2023-04-29 01:06:41 +03:00 committed by GitHub
parent bf77e2163b
commit c0ddec8a2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 96 additions and 1995 deletions

View file

@ -7,10 +7,11 @@ import (
"bytes"
"errors"
"io"
"math"
"os"
)
const maxInt = int(^uint(0) >> 1) // taken from bytes.Buffer
var (
// ErrInvalidMemorySize occurs if the memory size is not in a valid range
ErrInvalidMemorySize = errors.New("Memory size must be greater 0 and lower math.MaxInt32")
@ -36,7 +37,7 @@ type FileBackedBuffer struct {
// New creates a file backed buffer with a specific maximum memory size
func New(maxMemorySize int) (*FileBackedBuffer, error) {
if maxMemorySize < 0 || maxMemorySize > math.MaxInt32 {
if maxMemorySize < 0 || maxMemorySize > maxInt {
return nil, ErrInvalidMemorySize
}