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

Use go-defaults to set default value for file mode, use validate library to validate all blocks #25

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

lonegunmanb
Copy link
Member

go-defaults seems no longer maintained and due to this issue, it cannot set default value for pointer type field, I have to create my personal fork and merge this pr, then publish a new tag v1.3.0 based on the v1.2.0.

This pr also use github.com/go-playground/validator to validate all blocks.

Copy link
Member

@matt-FFFFFF matt-FFFFFF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one small comment.

I have tested this and it works with inputs of 0755 and 755 being equivalent.

if writeErr != nil {
err = multierror.Append(err, writeErr)
}
}

return err
}

func toDecimal(decimalMode fs.FileMode) (fs.FileMode, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we call the input octalMode instead of decimalMode?

@lonegunmanb
Copy link
Member Author

Only one small comment.

I have tested this and it works with inputs of 0755 and 755 being equivalent.

755 would trigger a golangci-lint issue so I have to use 0755.

@matt-FFFFFF
Copy link
Member

Only one small comment.
I have tested this and it works with inputs of 0755 and 755 being equivalent.

755 would trigger a golangci-lint issue so I have to use 0755.

I tested both 755 and 0755 in the grept config and they are equivalent. I like this as people often forget to put the leading zero.

@lonegunmanb lonegunmanb merged commit 9aae96f into main Jan 9, 2024
4 checks passed
@lonegunmanb lonegunmanb deleted the validateFileMode branch January 10, 2024 02:54
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.

2 participants