Skip to content

Commit

Permalink
go: remove ineff assignment, add missing err check
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
  • Loading branch information
katexochen committed Jan 12, 2024
1 parent c1b60fa commit ecd83bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ func (c *Config) FromFlags(fs *flag.FlagSet) {
}

fs.StringVar(&c.id, "id", "keep-sorted", "The identifier used to enable this tool in files.")
fs.MarkHidden("id")
if err := fs.MarkHidden("id"); err != nil {
panic(err)
}

of := &operationFlag{op: &c.operation}
if err := of.Set("fix"); err != nil {
Expand Down Expand Up @@ -147,7 +149,7 @@ func (f *lineRangeFlag) parse(vals []string) ([]keepsorted.LineRange, error) {
if err != nil {
return nil, fmt.Errorf("invalid line range %q: %w", val, err)
}
end := -1
var end int
if len(sp) == 1 {
end = start
} else {
Expand Down

0 comments on commit ecd83bf

Please sign in to comment.