We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f174c9 commit 348d24fCopy full SHA for 348d24f
protoc-gen-go/generator/generator.go
@@ -2105,6 +2105,16 @@ func (g *Generator) generateMessage(message *Descriptor) {
2105
})
2106
}
2107
2108
+ // Generate a naive setter.
2109
+ // I don't pretend to understand everything I am eliding by this simplicity.
2110
+ g.P("func (m *", ccTypeName, ") Set"+fname+"(v "+star+typename+") {")
2111
+ g.In()
2112
+ g.P("m." + fname + " = v")
2113
+ g.Out()
2114
+ g.P("}")
2115
+ g.P()
2116
+
2117
+ // Generate getter.
2118
g.P("func (m *", ccTypeName, ") "+mname+"() "+typename+" {")
2119
g.In()
2120
def, hasDef := defNames[field]
0 commit comments