chore: modernize the codebase using go 1.26 (#278)

This runs:

```
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./...
```

over the codebase, as this is using go 1.26, it can also use the new
new() functionallity so AsPtr and boolPtr is are needed anymore.

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2026-03-21 21:16:09 +10:00
committed by GitHub
parent a5baf6e5c3
commit 2ab58d24d4
19 changed files with 82 additions and 101 deletions
+12 -12
View File
@@ -17,57 +17,57 @@ func newIPFSLogger(l *slog.Logger) *ipfsLogger {
return &ipfsLogger{log: *l}
}
func (l *ipfsLogger) Debug(args ...interface{}) {
func (l *ipfsLogger) Debug(args ...any) {
l.log.Debug(fmt.Sprint(args...))
}
func (l *ipfsLogger) Debugf(format string, args ...interface{}) {
func (l *ipfsLogger) Debugf(format string, args ...any) {
l.log.Debug(fmt.Sprintf(format, args...))
}
func (l *ipfsLogger) Error(args ...interface{}) {
func (l *ipfsLogger) Error(args ...any) {
l.log.Error(fmt.Sprint(args...))
}
func (l *ipfsLogger) Errorf(format string, args ...interface{}) {
func (l *ipfsLogger) Errorf(format string, args ...any) {
l.log.Error(fmt.Sprintf(format, args...))
}
func (l *ipfsLogger) Fatal(args ...interface{}) {
func (l *ipfsLogger) Fatal(args ...any) {
l.log.Error(fmt.Sprint(args...))
os.Exit(1)
}
func (l *ipfsLogger) Fatalf(format string, args ...interface{}) {
func (l *ipfsLogger) Fatalf(format string, args ...any) {
l.log.Error(fmt.Sprintf(format, args...))
os.Exit(1)
}
func (l *ipfsLogger) Info(args ...interface{}) {
func (l *ipfsLogger) Info(args ...any) {
l.log.Info(fmt.Sprint(args...))
}
func (l *ipfsLogger) Infof(format string, args ...interface{}) {
func (l *ipfsLogger) Infof(format string, args ...any) {
l.log.Info(fmt.Sprintf(format, args...))
}
func (l *ipfsLogger) Panic(args ...interface{}) {
func (l *ipfsLogger) Panic(args ...any) {
msg := fmt.Sprint(args...)
l.log.Error(msg)
panic(msg)
}
func (l *ipfsLogger) Panicf(format string, args ...interface{}) {
func (l *ipfsLogger) Panicf(format string, args ...any) {
msg := fmt.Sprintf(format, args...)
l.log.Error(msg)
panic(msg)
}
func (l *ipfsLogger) Warn(args ...interface{}) {
func (l *ipfsLogger) Warn(args ...any) {
l.log.Warn(fmt.Sprint(args...))
}
func (l *ipfsLogger) Warnf(format string, args ...interface{}) {
func (l *ipfsLogger) Warnf(format string, args ...any) {
l.log.Warn(fmt.Sprintf(format, args...))
}