Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add goimports to the linter #1005

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ linters:
# TODO(AUT-202): errcheck is too handy to leave out but requires more churn
# at time of writing
# - errcheck
- goimports
- gosimple
- govet
- ineffassign
Expand Down
1 change: 1 addition & 0 deletions crypto11/aead.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"crypto/cipher"
"errors"
"fmt"

"github.com/miekg/pkcs11"
)

Expand Down
1 change: 1 addition & 0 deletions crypto11/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package crypto11

import (
"fmt"

"github.com/miekg/pkcs11"
)

Expand Down
3 changes: 2 additions & 1 deletion crypto11/blockmode.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ import (
"context"
"crypto/cipher"
"fmt"
"runtime"

"github.com/miekg/pkcs11"
"github.com/youtube/vitess/go/pools"
"runtime"
)

// cipher.BlockMode -----------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion crypto11/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func dsaGeneric(slot uint, key pkcs11.ObjectHandle, mechanism uint, digest []byt

// Pick a random label for a key
func generateKeyLabel() ([]byte, error) {
rawLabel := make([]byte, labelLength / 2)
rawLabel := make([]byte, labelLength/2)
var rand PKCS11RandReader
sz, err := rand.Read(rawLabel)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions crypto11/crypto11.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

// Package crypto11 enables access to cryptographic keys from PKCS#11 using Go crypto API.
//
// Simple use
// # Simple use
//
// 1. Either write a configuration file (see ConfigureFromFile) or
// define a configuration in your application (see PKCS11Config and
Expand All @@ -40,7 +40,7 @@
// or to *PKCS11PrivateKeyDSA, *PKCS11PrivateKeyECDSA or
// *PKCS11PrivateKeyRSA.
//
// Sessions and concurrency
// # Sessions and concurrency
//
// Note that PKCS#11 session handles must not be used concurrently
// from multiple threads. Consumers of the Signer interface know
Expand All @@ -64,7 +64,7 @@
//
// See also https://golang.org/pkg/crypto/
//
// Limitations
// # Limitations
//
// The PKCS1v15DecryptOptions SessionKeyLen field is not implemented
// and an error is returned if it is nonzero.
Expand Down
3 changes: 2 additions & 1 deletion crypto11/hmac.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ import (
"context"
"errors"
"fmt"
"hash"

"github.com/miekg/pkcs11"
"github.com/youtube/vitess/go/pools"
"hash"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions crypto11/sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ import (
"context"
"errors"
"fmt"
"github.com/miekg/pkcs11"
"github.com/youtube/vitess/go/pools"
"log"
"sync"

"github.com/miekg/pkcs11"
"github.com/youtube/vitess/go/pools"
)

// PKCS11Session is a pair of PKCS#11 context and a reference to a loaded session handle.
Expand Down
2 changes: 1 addition & 1 deletion signer/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ type Configuration struct {
SignerOpts crypto.SignerOpts `json:"signer_opts,omitempty" yaml:"signeropts,omitempty"`

isHsmAvailable bool
Hsm HSM
Hsm HSM
}

// InitHSM indicates that an HSM has been initialized
Expand Down
2 changes: 0 additions & 2 deletions tools/autograph-monitor/notifier.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package main

import ()

// Notifier is an interface for sending and resolving warning notifications
type Notifier interface {
// Send writes a message with an id to a notification channel
Expand Down