all: run "go fix"

This commit is contained in:
Filippo Valsorda
2025-12-25 20:42:59 +01:00
parent ec92694aad
commit abe371e157
12 changed files with 16 additions and 25 deletions

View File

@@ -37,7 +37,7 @@ func polymod(values []byte) uint32 {
top := chk >> 25
chk = (chk & 0x1ffffff) << 5
chk = chk ^ uint32(v)
for i := 0; i < 5; i++ {
for i := range 5 {
bit := top >> i & 1
if bit == 1 {
chk ^= generator[i]

View File

@@ -77,10 +77,7 @@ func (w *WrappedBase64Encoder) writeWrapped(p []byte) (int, error) {
panic("age: internal error: non-empty WrappedBase64Encoder.buf")
}
for len(p) > 0 {
toWrite := ColumnsPerLine - (w.written % ColumnsPerLine)
if toWrite > len(p) {
toWrite = len(p)
}
toWrite := min(ColumnsPerLine-(w.written%ColumnsPerLine), len(p))
n, _ := w.buf.Write(p[:toWrite])
w.written += n
p = p[n:]
@@ -228,7 +225,7 @@ func (e *ParseError) Unwrap() error {
return e.err
}
func errorf(format string, a ...interface{}) error {
func errorf(format string, a ...any) error {
return &ParseError{fmt.Errorf(format, a...)}
}

View File

@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build go1.18
// +build go1.18
package format_test