magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

Skip ignored private fields #61

Open rafaelhl opened 2 years ago

rafaelhl commented 2 years ago

This pull request allows adding some private fields on properties structs without having problems, only marking this field as skipped with a specific tag as the test example below.:

    type S struct {
        p     string `properties:"-"`
        X     string `properties:"-"`
        Undef string `properties:",default=some value"`
    }

This change will avoid an error cannot set p using the struct above.

rafaelhl commented 2 years ago

@magiconair Can you approve this PR? This change will turn more flexible the usage of the struct when we need to add some other internal fields.