Skip to content

Commit

Permalink
Remove usage of getopt to fix release. (#225)
Browse files Browse the repository at this point in the history
There seems to be some conflict with goreleaser, getopt/v2, getopt/v1
(through an indirect dep). We wanted to move off of getopt anyway, so
this is just a convenient excuse to make the change.

Verified we can get past the build step with

```sh
goreleaser release --skip-publish --rm-dist --debug --snapshot
```

so hopefully this is the last of it.

Signed-off-by: Billy Lynch <billy@chainguard.dev>

Signed-off-by: Billy Lynch <billy@chainguard.dev>
  • Loading branch information
wlynch authored Jan 26, 2023
1 parent aca7918 commit 3406c64
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions cmd/gitsign-credential-cache/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ import (
"syscall"

"github.com/coreos/go-systemd/v22/activation"
"github.com/pborman/getopt/v2"
"github.com/spf13/pflag"

"github.com/sigstore/gitsign/internal/cache/service"
"github.com/sigstore/gitsign/pkg/version"
)

var (
// Action flags
versionFlag = getopt.BoolLong("version", 'v', "print the version number")
systemdFlag = getopt.BoolLong("systemd-socket-activation", 's', "use systemd socket activation")
versionFlag = pflag.BoolP("version", "v", false, "print the version number")
systemdFlag = pflag.Bool("systemd-socket-activation", false, "use systemd socket activation")
)

func main() {
getopt.Parse()
pflag.Parse()
// Override default umask so created files are always scoped to the
// current user.
syscall.Umask(0077)
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ require (
github.com/jonboulle/clockwork v0.3.0
github.com/mattn/go-tty v0.0.4
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pborman/getopt/v2 v2.1.0
github.com/secure-systems-lab/go-securesystemslib v0.4.0
github.com/sigstore/cosign v1.13.1
github.com/sigstore/fulcio v1.0.0
github.com/sigstore/rekor v1.0.1
github.com/sigstore/sigstore v1.5.1
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
golang.org/x/crypto v0.5.0
golang.org/x/oauth2 v0.4.0
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
Expand Down Expand Up @@ -166,7 +166,6 @@ require (
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.15.0 // indirect
github.com/spiffe/go-spiffe/v2 v2.1.2 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,6 @@ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYr
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pborman/getopt v0.0.0-20180811024354-2b5b3bfb099b/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
github.com/pborman/getopt/v2 v2.1.0 h1:eNfR+r+dWLdWmV8g5OlpyrTYHkhVNxHBdN2cCrJmOEA=
github.com/pborman/getopt/v2 v2.1.0/go.mod h1:4NtW75ny4eBw9fO1bhtNdYTlZKYX5/tBLtsOpwKIKd0=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=
Expand Down

0 comments on commit 3406c64

Please sign in to comment.