Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor cleanup #11407

Closed
wants to merge 1 commit into from
Closed

Minor cleanup #11407

wants to merge 1 commit into from

Conversation

xiangpengzhao
Copy link
Contributor

  1. return nil instead of err when the value of err is nil.
  2. fix wrong type.

@sosiouxme
Copy link
Member

LGTM but travis is choking on "err" being redefined.

@xiangpengzhao
Copy link
Contributor Author

The travis log shows:

[WARNING] This version mismatch could lead to differences in execution between this run and the Origin CI systems.
pkg/gitserver/gitserver.go:160: declaration of "err" shadows declaration at pkg/gitserver/gitserver.go:156
pkg/gitserver/gitserver.go:166: declaration of "err" shadows declaration at pkg/gitserver/gitserver.go:156
pkg/gitserver/gitserver.go:174: declaration of "err" shadows declaration at pkg/gitserver/gitserver.go:156
pkg/gitserver/gitserver.go:183: declaration of "err" shadows declaration at pkg/gitserver/gitserver.go:156
pkg/gitserver/gitserver.go:196: declaration of "err" shadows declaration at pkg/gitserver/gitserver.go:156
pkg/gitserver/gitserver.go:200: declaration of "err" shadows declaration at pkg/gitserver/gitserver.go:196
pkg/gitserver/gitserver.go:254: declaration of "err" shadows declaration at pkg/gitserver/gitserver.go:225
pkg/gitserver/gitserver.go:336: declaration of "url" shadows declaration at pkg/gitserver/gitserver.go:9
pkg/gitserver/hooks.go:76: declaration of "err" shadows declaration at pkg/gitserver/hooks.go:57
pkg/gitserver/initializer.go:61: declaration of "err" shadows declaration at pkg/gitserver/initializer.go:44
pkg/gitserver/autobuild/autobuild.go:60: declaration of "err" shadows declaration at pkg/gitserver/autobuild/autobuild.go:42
pkg/gitserver/autobuild/autobuild.go:64: declaration of "err" shadows declaration at pkg/gitserver/autobuild/autobuild.go:60
pkg/gitserver/autobuild/autobuild.go:180: declaration of "err" shadows declaration at pkg/gitserver/autobuild/autobuild.go:146
[ERROR] PID 13137: hack/verify-govet.sh:74: `go tool vet -shadow -shadowstrict $test_dir` exited with status 1.
[INFO]      Stack Trace: 
[INFO]        1: hack/verify-govet.sh:74: `go tool vet -shadow -shadowstrict $test_dir`
[INFO]   Exiting with code 1.
make: *** [verify] Error 1

One of the related code blocks is:

    abs, err := filepath.Abs(home)
    if err != nil {
        return nil, fmt.Errorf("can't make %q absolute: %v", home, err)
    }
    if stat, err := os.Stat(abs); err != nil || !stat.IsDir() {
        return nil, fmt.Errorf("GIT_HOME must be an existing directory: %v", err)
    }

But it seems that we shouldn't modify the code. Then how to solve the travis flake? Should the script hack/verify-govet.sh be modified?

@sosiouxme Thanks!

@knobunc
Copy link
Contributor

knobunc commented Oct 19, 2016

LGTM [test]

@xiangpengzhao
Copy link
Contributor Author

Travis still failed due to the same error as is mentioned in my above comment. How can we solve this? @sosiouxme @knobunc Thanks!

@knobunc
Copy link
Contributor

knobunc commented Nov 2, 2016

Flake #11240 (perhaps?) re-[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to c89db5c

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10988/) (Base Commit: 6932bcc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants