diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e76be0e..1b8e7d5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -19,14 +19,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.24" - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1debfd8..0d18500 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,14 +12,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 + - name: golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: v2.4 + - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.24" - name: Run tests run: go test -v ./... diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5ecad03..6ace7ce 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -40,7 +40,8 @@ notarize: key: "{{.Env.MACOS_NOTARY_KEY}}" archives: - - format: zip + - formats: + - zip changelog: disable: false diff --git a/internal/certificate/certificate.go b/internal/certificate/certificate.go index fcaa60b..e1d1711 100644 --- a/internal/certificate/certificate.go +++ b/internal/certificate/certificate.go @@ -16,10 +16,9 @@ import ( const defaultTLSPort = "443" type Certificate struct { - addr string - name string - insecure bool - raw *x509.Certificate + addr string + name string + raw *x509.Certificate } var _ spiry.ExpiringResource = (*Certificate)(nil) @@ -113,7 +112,8 @@ func (c *Certificate) getCert() (cert *x509.Certificate, err error) { return } - defer conn.Close() + defer func() { _ = conn.Close() }() + certs := conn.ConnectionState().PeerCertificates cert = certs[0] return diff --git a/internal/domain/domain_test.go b/internal/domain/domain_test.go index d1bb631..10e060e 100644 --- a/internal/domain/domain_test.go +++ b/internal/domain/domain_test.go @@ -42,7 +42,7 @@ func handleConnection(c net.Conn) { log.Fatal(err) } - defer file.Close() + defer func() { _ = file.Close() }() scanner := bufio.NewScanner(file) for scanner.Scan() { @@ -55,7 +55,7 @@ func handleConnection(c net.Conn) { if err := scanner.Err(); err != nil { log.Fatal(err) } - c.Close() + _ = c.Close() } func startWhoisServer(l net.Listener) { @@ -70,7 +70,7 @@ func startWhoisServer(l net.Listener) { func stopWhoisServer(l net.Listener) { log.Printf("stopping fake whois server on %v\n", l.Addr().String()) - l.Close() + _ = l.Close() } func TestMain(m *testing.M) {