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

go: Add strucured header writer #404

Merged
merged 2 commits into from
Mar 15, 2019
Merged

go: Add strucured header writer #404

merged 2 commits into from
Mar 15, 2019

Conversation

irori
Copy link
Collaborator

@irori irori commented Mar 13, 2019

This adds ToString() method to the structured header types, and
uses it from signer.go.

This adds ToString() method to the structured header types, and
uses it from signer.go.
@irori irori requested review from hajimehoshi and nyaxt March 13, 2019 07:30
"unicode"
)

func (ll ListOfLists) ToString() (string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

String is more idiomatic in Go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Doesn't String() usually return just a string? This returns an error too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, but using To is not common in Go.

There is an actual usecase of String that also returns error: https://godoc.org/golang.org/x/text/encoding#Decoder.String

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it, thanks for finding the example. Done.

Copy link
Collaborator

@hajimehoshi hajimehoshi left a comment

Choose a reason for hiding this comment

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

lgtm

@irori irori merged commit f8735d2 into WICG:master Mar 15, 2019
@irori irori deleted the writer branch March 15, 2019 01:04
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