mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
all: cleanup unused code, part 1 (#10661)
Run `staticcheck` with `U1000` to find unused code. This cleans up about a half of it. I'll do the other half separately to keep PRs manageable. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
21
release/dist/cli/cli.go
vendored
21
release/dist/cli/cli.go
vendored
@@ -6,10 +6,7 @@ package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto"
|
||||
"crypto/x509"
|
||||
"encoding/binary"
|
||||
"encoding/pem"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
@@ -213,24 +210,6 @@ func runBuild(ctx context.Context, filters []string, targets []dist.Target) erro
|
||||
return nil
|
||||
}
|
||||
|
||||
func parseSigningKey(path string) (crypto.Signer, error) {
|
||||
if path == "" {
|
||||
return nil, nil
|
||||
}
|
||||
raw, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b, rest := pem.Decode(raw)
|
||||
if b == nil {
|
||||
return nil, fmt.Errorf("failed to decode PEM data in %q", path)
|
||||
}
|
||||
if len(rest) > 0 {
|
||||
return nil, fmt.Errorf("trailing data in %q, please check that the key file was not corrupted", path)
|
||||
}
|
||||
return x509.ParseECPrivateKey(b.Bytes)
|
||||
}
|
||||
|
||||
var genKeyArgs struct {
|
||||
root bool
|
||||
signing bool
|
||||
|
Reference in New Issue
Block a user