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

[dev] protoc-gen-go: format interfaces for gofmt 1.9 and 1.10 #486

Merged
merged 1 commit into from
Jan 18, 2018

Conversation

neild
Copy link
Contributor

@neild neild commented Jan 18, 2018

Change the pre-gofmt generated code for oneof discriminant interfaces
from:
type T interface { T() }
to:
type T interface {
T()
}

Prior to Go 1.9, gofmt rewrote the single-line form into the multi-line
one. Go 1.10 and later preserve the single-line form for single-method
interfaces. Generating code that is handled identically by both versions
of gofmt avoids spurious diffs with golden test data.

Change-Id: Ibb229827823a50e963bcd1b34e59a286654b415f

Change the pre-gofmt generated code for oneof discriminant interfaces
from:
  type T interface { T() }
to:
  type T interface {
  T()
  }

Prior to Go 1.9, gofmt rewrote the single-line form into the multi-line
one. Go 1.10 and later preserve the single-line form for single-method
interfaces. Generating code that is handled identically by both versions
of gofmt avoids spurious diffs with golden test data.

Change-Id: Ibb229827823a50e963bcd1b34e59a286654b415f
@neild neild requested a review from dsnet January 18, 2018 18:51
@dsnet dsnet merged commit 2bd7280 into dev Jan 18, 2018
@dsnet dsnet deleted the dneil-gofmt branch January 18, 2018 18:53
@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants