Enable formatters as well as linters

Currently gofmt and goimports have separate targets,
which means that they are forgotten for new changes.
pull/21870/head
Anders F Björklund 2025-11-08 09:13:12 +01:00
parent c67e946d27
commit c99ebd3d8e
7 changed files with 23 additions and 14 deletions

View File

@ -170,3 +170,10 @@ linters:
- path: '(.+)\.go$'
text: "Error return value of `.*` is not checked"
linter: errcheck
formatters:
enable:
- gofmt
- goimports
exclusions:
paths:
- third_party

View File

@ -20,13 +20,13 @@ import (
"bytes"
"embed"
"fmt"
"text/template"
"io"
"os"
"path"
"path/filepath"
"strconv"
"strings"
"text/template"
"time"
"github.com/pkg/errors"

View File

@ -139,11 +139,13 @@ Persistent Routes:
expectedRt := routingTable{
routingTableLine{
route: unsafeParseRoute("127.0.0.1", "10.96.0.0/12"),
line: " 10.96.0.0 255.240.0.0 127.0.0.1 127.0.0.1 281",
line: " 10.96.0.0 255.240.0.0" +
" 127.0.0.1 127.0.0.1 281",
},
routingTableLine{
route: unsafeParseRoute("192.168.1.2", "10.211.55.0/24"),
line: " 10.211.55.0 255.255.255.0 192.168.1.2 10.211.55.3 281",
line: " 10.211.55.0 255.255.255.0" +
" 192.168.1.2 10.211.55.3 281",
},
}
if !reflect.DeepEqual(rt.String(), expectedRt.String()) {