mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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>
This commit is contained in:
21
vendor/github.com/gin-gonic/gin/utils.go
generated
vendored
21
vendor/github.com/gin-gonic/gin/utils.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
|
||||
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
@ -12,13 +12,14 @@ import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
// BindKey indicates a default bind key.
|
||||
const BindKey = "_gin-gonic/gin/bindkey"
|
||||
|
||||
// Bind is a helper function for given interface object and returns a Gin middleware.
|
||||
func Bind(val interface{}) HandlerFunc {
|
||||
func Bind(val any) HandlerFunc {
|
||||
value := reflect.ValueOf(val)
|
||||
if value.Kind() == reflect.Ptr {
|
||||
panic(`Bind struct can not be a pointer. Example:
|
||||
@ -50,7 +51,7 @@ func WrapH(h http.Handler) HandlerFunc {
|
||||
}
|
||||
|
||||
// H is a shortcut for map[string]interface{}
|
||||
type H map[string]interface{}
|
||||
type H map[string]any
|
||||
|
||||
// MarshalXML allows type H to be used with xml.Marshal.
|
||||
func (h H) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
||||
@ -89,7 +90,7 @@ func filterFlags(content string) string {
|
||||
return content
|
||||
}
|
||||
|
||||
func chooseData(custom, wildcard interface{}) interface{} {
|
||||
func chooseData(custom, wildcard any) any {
|
||||
if custom != nil {
|
||||
return custom
|
||||
}
|
||||
@ -120,7 +121,7 @@ func lastChar(str string) uint8 {
|
||||
return str[len(str)-1]
|
||||
}
|
||||
|
||||
func nameOfFunction(f interface{}) string {
|
||||
func nameOfFunction(f any) string {
|
||||
return runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()
|
||||
}
|
||||
|
||||
@ -151,3 +152,13 @@ func resolveAddress(addr []string) string {
|
||||
panic("too many parameters")
|
||||
}
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/questions/53069040/checking-a-string-contains-only-ascii-characters
|
||||
func isASCII(s string) bool {
|
||||
for i := 0; i < len(s); i++ {
|
||||
if s[i] > unicode.MaxASCII {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user