|
243 | 243 | other than “this value was unspecified”.</p><h3 id=enum-aliases>Enum Value Aliases</h3><p>You can define aliases by assigning the same value to different enum constants.
|
244 | 244 | To do this you need to set the <code>allow_alias</code> option to <code>true</code>. Otherwise, the
|
245 | 245 | protocol buffer compiler generates a warning message when aliases are
|
246 |
| -found. Though all alias values are valid during deserialization, the first value |
247 |
| -is always used when serializing.</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-proto data-lang=proto><span style=display:flex><span><span style=color:#204a87;font-weight:700>enum</span> <span style=color:#000>EnumAllowingAlias</span> <span style=color:#000;font-weight:700>{</span><span style=color:#a40000> |
| 246 | +found. Though all alias values are valid for serialization, only the first value |
| 247 | +is used when deserializing.</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-proto data-lang=proto><span style=display:flex><span><span style=color:#204a87;font-weight:700>enum</span> <span style=color:#000>EnumAllowingAlias</span> <span style=color:#000;font-weight:700>{</span><span style=color:#a40000> |
248 | 248 | </span></span></span><span style=display:flex><span><span style=color:#a40000></span> <span style=color:#204a87;font-weight:700>option</span> <span style=color:#000>allow_alias</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#204a87;font-weight:700>true</span><span style=color:#000;font-weight:700>;</span><span style=color:#a40000>
|
249 | 249 | </span></span></span><span style=display:flex><span><span style=color:#a40000></span> <span style=color:#000>EAA_UNSPECIFIED</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#0000cf;font-weight:700>0</span><span style=color:#000;font-weight:700>;</span><span style=color:#a40000>
|
250 | 250 | </span></span></span><span style=display:flex><span><span style=color:#a40000></span> <span style=color:#000>EAA_STARTED</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#0000cf;font-weight:700>1</span><span style=color:#000;font-weight:700>;</span><span style=color:#a40000>
|
|
795 | 795 | for more.</li><li><code>--python_out</code> generates Python code in <code>DST_DIR</code>. See the
|
796 | 796 | <a href=/reference/python/python-generated>Python generated code reference</a>
|
797 | 797 | for more.</li><li><code>--go_out</code> generates Go code in <code>DST_DIR</code>. See the
|
798 |
| -<a href=/reference/go/go-generated>Go generated code reference</a> |
| 798 | +<a href=/reference/go/go-generated-opaque>Go generated code reference</a> |
799 | 799 | for more.</li><li><code>--ruby_out</code> generates Ruby code in <code>DST_DIR</code>. See the
|
800 | 800 | <a href=/reference/ruby/ruby-generated>Ruby generated code reference</a>
|
801 | 801 | for more.</li><li><code>--objc_out</code> generates Objective-C code in <code>DST_DIR</code>. See the
|
|
0 commit comments