Skip to content

Fix incorrect logic in GetDiskLun()#47

Draft
EricMountain wants to merge 1 commit intorelease-1.19-dd-v1.19.9-dd.1from
eric.mountain/pv-mixup-1
Draft

Fix incorrect logic in GetDiskLun()#47
EricMountain wants to merge 1 commit intorelease-1.19-dd-v1.19.9-dd.1from
eric.mountain/pv-mixup-1

Conversation

@EricMountain
Copy link
Member

@EricMountain EricMountain commented Nov 15, 2021

What type of PR is this?

What this PR does / why we need it:

See Go Operator Precedence.

package main

import (
	"fmt"
)

type DataDisk struct {
    Lun                     *int32                 `json:"lun,omitempty"`
}

func main() {
	var d DataDisk = DataDisk{}
	fmt.Printf("%v %v %d %v\n", false && false || false || true, d, d.Lun, d.Lun == nil)
}

https://play.golang.org/p/9r1y-5C99mr

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant