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 regression issue [multiple-value uuid.NewV4() in single-value context] #20

Closed
XiaoliangHuang opened this issue Apr 25, 2018 · 2 comments

Comments

@XiaoliangHuang
Copy link

issue

the uuid has regression issue that uuid.NewV4() will return multiple results, but not a single id. so code like this will faile

	// Create operation ID if it does not exist
	if _, ok := envelope.Tags[contracts.OperationId]; !ok {
		envelope.Tags[contracts.OperationId] = uuid.NewV4().String()
	}

with error

multiple-value uuid.NewV4() in single-value context

similar issue has been reported many times in the uuid official site.

fix

can use fix like this

client.sessionID = uuid.NewV4().String()
u,_ := uuid.NewV4()
client.sessionID = u.String()

see mlabouardy/dialogflow-go-client@951d289

@jjjordanmsft
Copy link
Contributor

This should be addressed by vendoring uuid to a specific version, which this SDK does via git submodules. The fix here would involve the change you suggest in tandem with updating the submodule version (though that could break people in the other direction if they have a funky setup).

@jjjordanmsft
Copy link
Contributor

I don't think panic()'ing on uuid failures is a good idea for this SDK. However, I will log about them. Ideally, NewRequestTelemetry might return an error but that raises some API consistency issues that I'm not entirely thrilled with.

Somewhat related, I now have satori/go.uuid#73 on my radar, even though committing now won't put us in a worse situation than we were already in.

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

No branches or pull requests

2 participants