<p>Hey , </p>
<p>im using go-endpoints
In the struct usage example , they used the endpoints:"req"` tag </p>
<p><a href="https://github.com/GoogleCloudPlatform/go-endpoints#usage" rel="nofollow">go-endpoints</a></p>
<p>that suppose to be a mandatory field ?</p>
<p>I tried to pass an empty value to a field with the endpoints:req tag and <strong>i didn't get any error</strong></p>
<p>What will be the best way to valid mandatory fields ?</p>
<p>i can do something like that but it must be a nicer solution</p>
<pre><code> if len(subscriptionToken) == 0 {
return endpoints.NewAPIError("subscriptionToken is empty", "subscriptionToken is empty", 400)
}
</code></pre>
<p>these anyone has an experience with endpoints and tag validation ? </p>
<p>Also im looking for alternative library to use in case the endpoints one won't work , which package you recommend ?</p>
<hr/>**评论:**<br/><br/>ninja_uzumaki: <pre><p>I think you would get more answers if you provide a link to go-endpoints and give more context into your problem.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传