Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ linters:
- gosimple
- govet
- ineffassign
# - staticcheck
- staticcheck
- structcheck
- typecheck
- unused
Expand Down
2 changes: 1 addition & 1 deletion cmd/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ func runImageCmd(cmd *cobra.Command, args []string) {
if err != nil {
klog.Fatalf("error: %v", err)
}
fmt.Printf(image)
fmt.Print(image)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no formatting of the strings required here.

}
12 changes: 5 additions & 7 deletions pkg/cvo/egress.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ func (optr *Operator) getHTTPSProxyURL() (*url.URL, error) {
return nil, err
}

if &proxy.Spec != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proxy is referenced and compared to nil. Since proxy is a value type this check will never be false.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I'm not entirely sure if these are equivalent.

/cc @jottofar @wking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change the check. I removed it and what you see now is the inner-check. The outer-check was superfluous for the reason mentioned above.

if proxy.Spec.HTTPSProxy != "" {
proxyURL, err := url.Parse(proxy.Spec.HTTPSProxy)
if err != nil {
return nil, err
}
return proxyURL, nil
if proxy.Spec.HTTPSProxy != "" {
proxyURL, err := url.Parse(proxy.Spec.HTTPSProxy)
if err != nil {
return nil, err
}
return proxyURL, nil
}
return nil, nil
}
Expand Down