Skip to content

Commit

Permalink
misc: go vet fixes
Browse files Browse the repository at this point in the history
These are some code problems flagged by `go vet` that shouldn't affect
correctness at all.

Signed-off-by: Hank Donnay <[email protected]>
  • Loading branch information
hdonnay committed Jan 14, 2021
1 parent 733d8f1 commit 4840e07
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions digest.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ func (d *Digest) Scan(i interface{}) error {
return nil
default:
return &DigestError{msg: fmt.Sprintf("invalid digest type: %T", v)}

}
panic("the default case should return before this panic is reached.")
}

// Value implements driver.Valuer.
Expand Down
2 changes: 1 addition & 1 deletion rhel/updaterset.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type Factory struct {
}

type FactoryConfig struct {
URL string `json:"url", yaml:"url"`
URL string `json:"url" yaml:"url"`
}

func (f *Factory) Configure(ctx context.Context, cfg driver.ConfigUnmarshaler, c *http.Client) error {
Expand Down
3 changes: 0 additions & 3 deletions rpm/packagescanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,4 @@ func parsePackage(ctx context.Context, log zerolog.Logger, src map[string]*clair
return nil, err
}
}

// Should have cleanly returned when io.EOF was hit.
panic("unreachable")
}

0 comments on commit 4840e07

Please sign in to comment.