V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
ohohohh
V2EX  ›  Go 编程语言

bufbuild/protovalidate 如何判断 string 是否为空跟未设置

  •  
  •   ohohohh · 133 天前 · 1287 次点击
    这是一个创建于 133 天前的主题,其中的信息可能已经有所发展或是发生改变。
    当 string username = "跟未设置 username ,如何让检验返回自定义错误?

    string username = 2 [
    (buf.validate.field).cel = {
    id: "username.not_empty",
    message: "username not Empty",
    expression: "this.size() > 1"
    }
    ];
    1 条回复    2025-08-06 23:30:36 +08:00
    qzzz
        1
    qzzz  
       128 天前
    optional string bar = 1;
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2436 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 10:46 · PVG 18:46 · LAX 02:46 · JFK 05:46
    ♥ Do have faith in what you're doing.