Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
cmd/app: remove dependency on deprecated github.com/pkg/errors
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
  • Loading branch information
zchee committed May 19, 2022
commit 9aabd619e72de9cee3028d6f0233e314bfc01f10
2 changes: 1 addition & 1 deletion cmd/app/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ package app

import (
"context"
"errors"
"fmt"
"net/http"
"strconv"
"strings"
"time"

"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sigstore/fulcio/pkg/api"
gw "github.com/sigstore/fulcio/pkg/generated/protobuf"
Expand Down
7 changes: 3 additions & 4 deletions cmd/app/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (

ctclient "github.com/google/certificate-transparency-go/client"
"github.com/google/certificate-transparency-go/jsonclient"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
certauth "github.com/sigstore/fulcio/pkg/ca"
Expand Down Expand Up @@ -253,11 +252,11 @@ func runServeCmd(cmd *cobra.Command, args []string) {
func checkServeCmdConfigFile() error {
if serveCmdConfigFilePath != "" {
if _, err := os.Stat(serveCmdConfigFilePath); err != nil {
return errors.Wrap(err, "unable to stat config file provided")
return fmt.Errorf("unable to stat config file provided: %w", err)
}
abspath, err := filepath.Abs(serveCmdConfigFilePath)
if err != nil {
return errors.Wrap(err, "unable to determine absolute path of config file provided")
return fmt.Errorf("unable to determine absolute path of config file provided: %w", err)
}
extWithDot := filepath.Ext(abspath)
ext := strings.TrimPrefix(extWithDot, ".")
Expand All @@ -275,7 +274,7 @@ func checkServeCmdConfigFile() error {
viper.SetConfigType(ext)
viper.AddConfigPath(filepath.Dir(serveCmdConfigFilePath))
if err := viper.ReadInConfig(); err != nil {
return errors.Wrap(err, "unable to parse config file provided")
return fmt.Errorf("unable to parse config file provided: %w", err)
}
}
return nil
Expand Down
3 changes: 1 addition & 2 deletions cmd/app/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package app
import (
"fmt"

"github.com/pkg/errors"
"github.com/sigstore/fulcio/pkg/api"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -50,7 +49,7 @@ func runVersion(opts *versionOptions) error {
if opts.json {
j, err := v.JSONString()
if err != nil {
return errors.Wrap(err, "unable to generate JSON from version info")
return fmt.Errorf("unable to generate JSON from version info: %w", err)
}
res = j
}
Expand Down