Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: refactor mvsReqs.Max for better readability #39042
At head (go version devel +e90b0ce68b Sat May 2 20:22:19 2020 +0000 darwin/amd64) I see this function in src/go/cmd/go/internal/modload/mvs.go:
I believe that "return v1" is wrong if v1 is empty, and the code should be something like:
but I am not confident of the semantics this function requires. Moreover, since Compare protects against bad parses, it's possible no checking is required:
I think this is working as intended, but the code could be refactored for better readability.
We should refactor this for better readability. We should explain why