1
0
Fork 0
forked from forgejo/forgejo

Replace interface{} with any (#25686) (#25687)

Same perl replacement as https://github.com/go-gitea/gitea/pull/25686
but for 1.20 to ease future backporting.
This commit is contained in:
silverwind 2023-07-05 05:41:32 +02:00 committed by GitHub
parent 4e310133f9
commit 24e64fe372
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
233 changed files with 729 additions and 729 deletions

View file

@ -90,7 +90,7 @@ Usage: %[1]s [-v] [-o output.go] ambiguous.json
sort.Slice(tables, func(i, j int) bool {
return tables[i].Locale < tables[j].Locale
})
data := map[string]interface{}{
data := map[string]any{
"Tables": tables,
}
@ -99,7 +99,7 @@ Usage: %[1]s [-v] [-o output.go] ambiguous.json
}
}
func runTemplate(t *template.Template, filename string, data interface{}) error {
func runTemplate(t *template.Template, filename string, data any) error {
buf := bytes.NewBuffer(nil)
if err := t.Execute(buf, data); err != nil {
return fmt.Errorf("unable to execute template: %w", err)
@ -172,17 +172,17 @@ var AmbiguousCharacters = map[string]*AmbiguousTable{
`))
func logf(format string, args ...interface{}) {
func logf(format string, args ...any) {
fmt.Fprintf(os.Stderr, format+"\n", args...)
}
func verbosef(format string, args ...interface{}) {
func verbosef(format string, args ...any) {
if verbose {
logf(format, args...)
}
}
func fatalf(format string, args ...interface{}) {
func fatalf(format string, args ...any) {
logf("fatal: "+format+"\n", args...)
os.Exit(1)
}