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

fix: data race warnings #102

Merged
merged 8 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions v5/core/cp4d_authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ func newCloudPakForDataAuthenticatorFromMap(properties map[string]string) (*Clou
}

// AuthenticationType returns the authentication type for this authenticator.
func (CloudPakForDataAuthenticator) AuthenticationType() string {
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know if is there a specific reason why this used as a value or not, but hopefully changing it to pointer won't break anything. All tests passed btw.

@padamstx What's your take on this?

func (*CloudPakForDataAuthenticator) AuthenticationType() string {
return AUTHTYPE_CP4D
}

// Validate the authenticator's configuration.
//
// Ensures the username, password, and url are not Nil. Additionally, ensures
// they do not contain invalid characters.
func (authenticator CloudPakForDataAuthenticator) Validate() error {
func (authenticator *CloudPakForDataAuthenticator) Validate() error {

if authenticator.Username == "" {
return fmt.Errorf(ERRORMSG_PROP_MISSING, "Username")
Expand Down
4 changes: 2 additions & 2 deletions v5/core/iam_authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func newIamAuthenticatorFromMap(properties map[string]string) (authenticator *Ia
}

// AuthenticationType returns the authentication type for this authenticator.
func (IamAuthenticator) AuthenticationType() string {
func (*IamAuthenticator) AuthenticationType() string {
return AUTHTYPE_IAM
}

Expand Down Expand Up @@ -175,7 +175,7 @@ func (authenticator *IamAuthenticator) setTokenData(tokenData *iamTokenData) {
//
// Ensures the ApiKey is valid, and the ClientId and ClientSecret pair are
// mutually inclusive.
func (this IamAuthenticator) Validate() error {
func (this *IamAuthenticator) Validate() error {
if this.ApiKey == "" {
return fmt.Errorf(ERRORMSG_PROP_MISSING, "ApiKey")
}
Expand Down