Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <[email protected]>
  • Loading branch information
cpanato committed May 2, 2024
1 parent 87f50e7 commit b34af70
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 36 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/build-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LDFLAGS: ${{ env.GO_FLAGS }}

- name: Generate subject
id: hash
env:
ARTIFACTS: "${{ steps.run-goreleaser.outputs.artifacts }}"
run: |
set -euo pipefail
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
- name: Set tag output
id: tag
run: echo "tag_name=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"

provenance:
needs:
- snapshot
permissions:
actions: read # To read the workflow path.
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.release.outputs.hashes }}"
upload-assets: false
continue-on-error: true
4 changes: 2 additions & 2 deletions cmd/fetch-tsa-certs/fetch_tsa_certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func fetchCertificateChain(ctx context.Context, parent, intermediateKMSKey, leaf
if err != nil {
return nil, err
}
intermediateSigner, _, err := intermediateKMSSigner.CryptoSigner(ctx, func(err error) {})
intermediateSigner, _, err := intermediateKMSSigner.CryptoSigner(ctx, func(_ error) {})
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -176,7 +176,7 @@ func fetchCertificateChain(ctx context.Context, parent, intermediateKMSKey, leaf
if err != nil {
return nil, err
}
leafKMSSigner, _, err = kmsSigner.CryptoSigner(ctx, func(err error) {})
leafKMSSigner, _, err = kmsSigner.CryptoSigner(ctx, func(_ error) {})
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/timestamp-cli/app/format/wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type CobraCmd func(cmd *cobra.Command, args []string)
type formatCmd func(args []string) (interface{}, error)

func WrapCmd(f formatCmd) CobraCmd {
return func(cmd *cobra.Command, args []string) {
return func(_ *cobra.Command, args []string) {
obj, err := f(args)
if err != nil {
log.CliLogger.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions cmd/timestamp-cli/app/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ var inspectCmd = &cobra.Command{
Use: "inspect",
Short: "Inspect timestamp",
Long: "Inspect the signed timestamp response.",
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
if err := viper.BindPFlags(cmd.Flags()); err != nil {
log.CliLogger.Fatal("Error initializing cmd line args: ", err)
}
return nil
},
Run: format.WrapCmd(func(args []string) (interface{}, error) {
Run: format.WrapCmd(func(_ []string) (interface{}, error) {
tsr := viper.GetString("timestamp")
tsrBytes, err := os.ReadFile(filepath.Clean(tsr))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/timestamp-cli/app/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var rootCmd = &cobra.Command{
Use: "timestamp-cli",
Short: "Timestamp CLI",
Long: `Timestamp command line interface tool`,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
return initConfig(cmd)
},
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/timestamp-cli/app/timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ var timestampCmd = &cobra.Command{
Use: "timestamp",
Short: "Signed timestamp command",
Long: "Fetches a signed RFC 3161 timestamp. The timestamp response can be verified locally using a timestamp certificate chain.",
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
if err := viper.BindPFlags(cmd.Flags()); err != nil {
log.CliLogger.Fatal("Error initializing cmd line args: ", err)
}
return nil
},
Run: format.WrapCmd(func(args []string) (interface{}, error) {
Run: format.WrapCmd(func(_ []string) (interface{}, error) {
return runTimestamp()
}),
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/timestamp-cli/app/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ var verifyCmd = &cobra.Command{
Use: "verify",
Short: "Verify timestamp",
Long: "Verify the timestamp response using a timestamp certificate chain.",
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
if err := viper.BindPFlags(cmd.Flags()); err != nil {
log.CliLogger.Fatal("Error initializing cmd line args: ", err)
}
return nil
},
Run: format.WrapCmd(func(args []string) (interface{}, error) {
Run: format.WrapCmd(func(_ []string) (interface{}, error) {
return runVerify()
}),
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/timestamp-server/app/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var serveCmd = &cobra.Command{
Use: "serve",
Short: "start http server with configured api",
Long: `Starts a http server and serves the configured api`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
if err := viper.BindPFlags(cmd.Flags()); err != nil {
log.Logger.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/signer/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewCryptoSigner(ctx context.Context, hash crypto.Hash, signer, kmsKey, tink
if err != nil {
return nil, err
}
s, _, err := signer.CryptoSigner(ctx, func(err error) {})
s, _, err := signer.CryptoSigner(ctx, func(_ error) {})
return s, err
case TinkScheme:
primaryKey, err := GetPrimaryKey(ctx, tinkKmsKey, hcVaultToken)
Expand Down

0 comments on commit b34af70

Please sign in to comment.