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

uuid.NewV4() returns two values #12

Merged
merged 1 commit into from
Feb 8, 2018

Conversation

plasticlife-art
Copy link
Contributor

so compiler returns error

@@ -44,7 +44,8 @@ func NewDialogFlowClient(options Options) (error, *DialogFlowClient) {

client.sessionID = options.SessionID
if client.sessionID == "" {
client.sessionID = uuid.NewV4().String()
u,_ := uuid.NewV4()
Copy link

Choose a reason for hiding this comment

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

I would suggest raising the error in the event that err is not nil. If u is nil, it's better to catch it here with a helpful error message.

if uuid, err := uuid.NewV4(); err != nil {
	return fmt.Errorf("Error generating new UUID: %s", err), nil
} else {
	client.sessionID = uuid.String()
}

@awonak
Copy link

awonak commented Feb 1, 2018

The breaking change in go.uuid was introduced here: satori/go.uuid#18

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.

None yet

3 participants