-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add user group support #234
Conversation
"github.com/asteris-llc/converge/resource" | ||
) | ||
|
||
const ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's typical for an enum like this to define a custom string alias and then use that, to make it clear that non any 'ol string will do.
type State string
const Present State = "present"
// and then...
type Group struct {
State State
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh and they should probably be prefixed StatePresent
etc
ca857f5
to
c7b03c4
Compare
|
||
const ( | ||
GID_MIN = 1000 | ||
GID_MAX = 32767 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you document these constants, BTW? Just a comment will do. They're kind of random-looking otherwise
c7b03c4
to
1dabf8a
Compare
if err != nil { | ||
return nil, err | ||
} | ||
if gidVal >= math.MaxUint32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this validation. Setting the bit size parameter in the ParseUint
call above should take care of it. https://play.golang.org/p/E1b_Asq0WQ
1dabf8a
to
dfd5a89
Compare
PR feedback addressed. |
Adds support for user group:
Includes sample/group.hcl
If no
"state"
is included, the default is"present"