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

btcd: fix conversion of int to string failing in Go 1.15 #1619

Merged
merged 2 commits into from
Aug 31, 2020

Conversation

federicobond
Copy link
Contributor

Without this, btcd fails to build in Go 1.15 with the following message:

./upnp.go:232:20: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

@@ -201,7 +201,7 @@ func TestAssignFieldErrors(t *testing.T) {
}{
{
name: "general incompatible int -> string",
dest: string(0),
dest: "\x00",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason to not use string(rune(0)) here? By the way, "\x00" is fine too..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No reason, it just felt more natural to write "\x00" for me.

Copy link
Collaborator

@onyb onyb left a comment

Choose a reason for hiding this comment

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

LGTM. 🚀

This was referenced Aug 31, 2020
Copy link
Collaborator

@jakesylvestre jakesylvestre left a comment

Choose a reason for hiding this comment

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

Awesome! I ran this in xplorfin#12 and it appears to fix all the go 1.15 issues for this repo. LGTM!

@jakesylvestre jakesylvestre merged commit 35194e2 into btcsuite:master Aug 31, 2020
@federicobond federicobond deleted the fix-conversion branch September 1, 2020 00:26
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.

3 participants