V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
ohohohh

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

  •  
  •   ohohohh · Aug 2, 2025 · 1491 views
    This topic created in 268 days ago, the information mentioned may be changed or developed.
    当 string username = "跟未设置 username ,如何让检验返回自定义错误?

    string username = 2 [
    (buf.validate.field).cel = {
    id: "username.not_empty",
    message: "username not Empty",
    expression: "this.size() > 1"
    }
    ];
    1 replies    2025-08-06 23:30:36 +08:00
    qzzz
        1
    qzzz  
       Aug 6, 2025
    optional string bar = 1;
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3289 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 13:24 · PVG 21:24 · LAX 06:24 · JFK 09:24
    ♥ Do have faith in what you're doing.