8000 Add object sensitivity to struct field handling · Issue #339 · uber-go/nilaway · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
Add object sensitivity to struct field handling #339
Open
@sonalmahajan15

Description

@sonalmahajan15
type S struct {
	Field *int
}

func f1() *S {
	s := &S{}
	s.Field = nil
        return s
}

func f2() {
	s := &S{Field: new(int)}
        return s
}

func test() {
        s1 := f1()
	print(*s1.Field) // report error here

        s2 := f2()
	print(*s2.Field) // safe
}


Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0