Skip to content

Commit

Permalink
cmd/cue/cmd: remove unused code
Browse files Browse the repository at this point in the history
When refactoring cue/load, I noticed that some pieces of code
were unused, which makes it less obvious what kinds of things
can be done. I used `staticcheck` to point out many other
places in the code that are unused.

This is one of those places.  I feel it's better to remove this code
even if it might be used in the future (it's always there to be found
in the git history).

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I00923f428cd24def15907946c58202a58a9f1cdc
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/549297
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
rogpeppe committed Apr 6, 2023
1 parent 731ddd9 commit aa8c66f
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions cmd/cue/cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package cmd

import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)

Expand Down Expand Up @@ -112,22 +111,3 @@ func (f flagName) StringArray(cmd *Command) []string {
v, _ := cmd.Flags().GetStringArray(string(f))
return v
}

type stringFlag struct {
name string
short string
text string
def string
}

func (f *stringFlag) Add(cmd *cobra.Command) {
cmd.Flags().StringP(f.name, f.short, f.def, f.text)
}

func (f *stringFlag) String(cmd *Command) string {
v, err := cmd.Flags().GetString(f.name)
if err != nil {
return f.def
}
return v
}

0 comments on commit aa8c66f

Please sign in to comment.