Skip to content

Commit

Permalink
all: fix missing convert
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
  • Loading branch information
zchee committed May 19, 2022
1 parent 0aa7731 commit de0f2c1
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion cmd/rekor-cli/app/log_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"crypto/x509"
"encoding/hex"
"encoding/pem"
"errors"
"fmt"
"time"

"github.com/go-openapi/swag"
"github.com/pkg/errors"
rclient "github.com/sigstore/rekor/pkg/generated/client"
"github.com/sigstore/rekor/pkg/generated/models"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/rekor-server/app/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"crypto/x509"
"encoding/json"
"encoding/pem"
"errors"
"flag"
"fmt"
"os"
Expand All @@ -29,7 +30,6 @@ import (
_ "gocloud.dev/blob/fileblob" // fileblob
_ "gocloud.dev/blob/gcsblob"

"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"gocloud.dev/blob"
Expand Down
8 changes: 4 additions & 4 deletions pkg/sharding/ranges.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package sharding
import (
"context"
"encoding/base64"
"errors"
"fmt"
"io/ioutil"
"strconv"
Expand All @@ -26,7 +27,6 @@ import (
"github.com/ghodss/yaml"
"github.com/google/trillian"
"github.com/google/trillian/types"
"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/log"
)

Expand Down Expand Up @@ -55,12 +55,12 @@ func NewLogRanges(ctx context.Context, logClient trillian.TrillianLogClient, pat
// otherwise, try to read contents of the sharding config
ranges, err := logRangesFromPath(path)
if err != nil {
return LogRanges{}, fmt.Errorf("log ranges from path: %w: %w", err)
return LogRanges{}, fmt.Errorf("log ranges from path: %w", err)
}
for i, r := range ranges {
r, err := updateRange(ctx, logClient, r)
if err != nil {
return LogRanges{}, fmt.Errorf("updating range for tree id %d: %w: %w", r.TreeID, err)
return LogRanges{}, fmt.Errorf("updating range for tree id %d: %w", r.TreeID, err)
}
ranges[i] = r
}
Expand Down Expand Up @@ -93,7 +93,7 @@ func updateRange(ctx context.Context, logClient trillian.TrillianLogClient, r Lo
if r.TreeLength == 0 {
resp, err := logClient.GetLatestSignedLogRoot(ctx, &trillian.GetLatestSignedLogRootRequest{LogId: r.TreeID})
if err != nil {
return LogRange{}, fmt.Errorf("getting signed log root for tree %d: %w: %w", r.TreeID, err)
return LogRange{}, fmt.Errorf("getting signed log root for tree %d: %w", r.TreeID, err)
}
var root types.LogRootV1
if err := root.UnmarshalBinary(resp.SignedLogRoot.LogRoot); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/alpine/alpine.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package alpine

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/types"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/types/alpine/apk.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (
"crypto/sha256"
"encoding/hex"
"encoding/pem"
"errors"
"fmt"
"hash"
"io"
"strings"

"github.com/pkg/errors"
"github.com/sigstore/sigstore/pkg/signature"
"github.com/sigstore/sigstore/pkg/signature/options"
"gopkg.in/ini.v1"
Expand Down Expand Up @@ -178,12 +178,12 @@ func (p *Package) Unmarshal(pkgReader io.Reader) error {
if header.Name == ".PKGINFO" {
pkginfoContent := make([]byte, header.Size)
if _, err = ctlReader.Read(pkginfoContent); err != nil && err != io.EOF {
return fmt.Errorf("reading .PKGINFO: %w: %w", err)
return fmt.Errorf("reading .PKGINFO: %w", err)
}

pkg.Pkginfo, err = parsePkginfo(pkginfoContent)
if err != nil {
return fmt.Errorf("parsing .PKGINFO: %w: %w", err)
return fmt.Errorf("parsing .PKGINFO: %w", err)
}
pkg.Datahash, err = hex.DecodeString(pkg.Pkginfo["datahash"])
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/types/hashedrekord/hashedrekord.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package hashedrekord

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/types"
)
Expand Down Expand Up @@ -64,7 +64,7 @@ func (rt *BaseRekordType) CreateProposedEntry(ctx context.Context, version strin
}
ei, err := rt.VersionedUnmarshal(nil, version)
if err != nil {
return nil, fmt.Errorf("fetching hashed Rekord version implementation: %w: %w", err)
return nil, fmt.Errorf("fetching hashed Rekord version implementation: %w", err)
}

return ei.CreateFromArtifactProperties(ctx, props)
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/hashedrekord/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"path/filepath"
Expand All @@ -29,7 +30,6 @@ import (
"github.com/asaskevich/govalidator"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/pkg/errors"

"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/log"
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package helm

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/types"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/helm/provenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ package helm

import (
"bytes"
"errors"
"fmt"
"io"
"strings"

"github.com/ghodss/yaml"
"github.com/pkg/errors"

"golang.org/x/crypto/openpgp/clearsign"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/types/helm/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/pkg/errors"

"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/sigstore/rekor/pkg/generated/models"
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/intoto/intoto.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package intoto

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/types"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/intoto/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"

"github.com/pkg/errors"
"errors"

"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/log"
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/jar/jar.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package jar

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/types"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/rekord/rekord.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package rekord

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/types"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/rfc3161/rfc3161.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package rfc3161

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/types"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/rpm/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package rpm

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/generated/models"
"github.com/sigstore/rekor/pkg/types"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/tuf/tuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package tuf

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/types"

"github.com/sigstore/rekor/pkg/generated/models"
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strconv"
"strings"

"github.com/pkg/errors"
"errors"
)

// heavily borrowed from https://github.com/google/trillian-examples/blob/master/formats/log/checkpoint.go
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/pubkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package util
import (
"context"
"crypto/ecdsa"
"errors"

"github.com/pkg/errors"
"github.com/sigstore/rekor/pkg/generated/client"
"github.com/sigstore/rekor/pkg/generated/client/pubkey"
"github.com/sigstore/sigstore/pkg/cryptoutils"
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/signed_note.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"crypto/x509"
"encoding/base64"
"encoding/binary"
"errors"
"fmt"
"strings"

"github.com/pkg/errors"
"github.com/sigstore/sigstore/pkg/signature"
"github.com/sigstore/sigstore/pkg/signature/options"
"golang.org/x/mod/sumdb/note"
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/timestamp_note.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"strings"
"time"

"github.com/pkg/errors"
"errors"
)

// Signed note based timestamp responses
Expand Down

0 comments on commit de0f2c1

Please sign in to comment.